diff options
author | Chris Craik <ccraik@google.com> | 2015-10-05 13:00:52 -0700 |
---|---|---|
committer | Chris Craik <ccraik@google.com> | 2015-10-14 16:10:40 -0700 |
commit | b565df13a9e5c7b1d7d93bdfa4a793752d66d3cc (patch) | |
tree | 4a2dadd3b2c95663c23a626eff75962a0b8d4ce2 /libs/hwui/RenderNode.h | |
parent | b08949151f8dfc7a72ea6696f2e6067c2b1643bb (diff) |
Initial commit of new Canvas operation recording / replay
Done:
- drawRect, drawBitmap, drawColor, drawPaint, drawRenderNode, drawRegion
- Recording with new DisplayList format
- batching & reordering
- Stateless op reorder
- Stateless op rendering
- Frame lifecycle (clear, geterror, cleanup)
Not done:
- SaveLayer (clipped and unclipped)
- HW layers
- Complex clipping
- Ripple projection
- Z reordering
- Z shadows
- onDefer prefetching (text + task kickoff)
- round rect clip
- linear allocation for std collections
- AssetAtlas support
Change-Id: Iaf98c1a3aeab5fa47cc8f9c6d964420abc0e7691
Diffstat (limited to 'libs/hwui/RenderNode.h')
-rw-r--r-- | libs/hwui/RenderNode.h | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/libs/hwui/RenderNode.h b/libs/hwui/RenderNode.h index 88fc60856feb..ff673ba32343 100644 --- a/libs/hwui/RenderNode.h +++ b/libs/hwui/RenderNode.h @@ -29,8 +29,8 @@ #include "AnimatorManager.h" #include "Debug.h" -#include "Matrix.h" #include "DisplayList.h" +#include "Matrix.h" #include "RenderProperties.h" #include <vector> @@ -43,6 +43,7 @@ class SkRegion; namespace android { namespace uirenderer { +class CanvasState; class DisplayListOp; class DisplayListCanvas; class OpenGLRenderer; @@ -74,6 +75,7 @@ class RenderNode; * attached. */ class RenderNode : public VirtualLightRefBase { +friend class TestUtils; // allow TestUtils to access syncDisplayList / syncProperties public: enum DirtyPropertyMask { GENERIC = 1 << 1, @@ -176,8 +178,25 @@ public: AnimatorManager& animators() { return mAnimatorManager; } + // Returns false if the properties dictate the subtree contained in this RenderNode won't render + bool applyViewProperties(CanvasState& canvasState) const; + void applyViewPropertyTransforms(mat4& matrix, bool true3dTransform = false) const; + bool nothingToDraw() const { + const Outline& outline = properties().getOutline(); + return mDisplayListData == nullptr + || properties().getAlpha() <= 0 + || (outline.getShouldClip() && outline.isEmpty()) + || properties().getScaleX() == 0 + || properties().getScaleY() == 0; + } + + // Only call if RenderNode has DisplayListData... + const DisplayListData& getDisplayListData() const { + return *mDisplayListData; + } + private: typedef key_value_pair_t<float, DrawRenderNodeOp*> ZDrawRenderNodeOpPair; @@ -235,6 +254,10 @@ private: const char* mText; }; + + void syncProperties(); + void syncDisplayList(); + void prepareTreeImpl(TreeInfo& info, bool functorsNeedLayer); void pushStagingPropertiesChanges(TreeInfo& info); void pushStagingDisplayListChanges(TreeInfo& info); |