diff options
author | 2021-01-13 22:39:32 -0500 | |
---|---|---|
committer | 2021-01-14 03:55:58 +0000 | |
commit | be67195c44163c03d88af43b9d58b7e22139c0a9 (patch) | |
tree | 07d5f55ece853636eea9d7273b84fc2d7080dd2b /libs/hwui/RenderNode.h | |
parent | 844516c4946fa200afab9575cb154a962779b74f (diff) |
Convert DisplayList to a value-type wrapper
Make DisplayList its own type instead of an alias,
pushing the Skia aspect behind it mostly. Removes a bunch
of manual memory management and opens the door to DisplayList
being a union type with multiple implementations
Test: builds (somehow), boots, hwuiunit passes, CtsUiRendering passes
Change-Id: I1d7806aa3afc5d9ece08b06959920078a5814c59
Diffstat (limited to 'libs/hwui/RenderNode.h')
-rw-r--r-- | libs/hwui/RenderNode.h | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/libs/hwui/RenderNode.h b/libs/hwui/RenderNode.h index 1eaf0d425818..39ea53b6e3b3 100644 --- a/libs/hwui/RenderNode.h +++ b/libs/hwui/RenderNode.h @@ -100,17 +100,17 @@ public: // See flags defined in DisplayList.java enum ReplayFlag { kReplayFlag_ClipChildren = 0x1 }; - void setStagingDisplayList(DisplayList* newData); + void setStagingDisplayList(DisplayList&& newData); void discardStagingDisplayList(); void output(); int getUsageSize(); int getAllocatedSize(); - bool isRenderable() const { return mDisplayList && !mDisplayList->isEmpty(); } + bool isRenderable() const { return mDisplayList.hasContent(); } bool hasProjectionReceiver() const { - return mDisplayList && mDisplayList->containsProjectionReceiver(); + return mDisplayList.containsProjectionReceiver(); } const char* getName() const { return mName.string(); } @@ -169,12 +169,14 @@ public: bool nothingToDraw() const { const Outline& outline = properties().getOutline(); - return mDisplayList == nullptr || properties().getAlpha() <= 0 || + return !mDisplayList.isValid() || properties().getAlpha() <= 0 || (outline.getShouldClip() && outline.isEmpty()) || properties().getScaleX() == 0 || properties().getScaleY() == 0; } - const DisplayList* getDisplayList() const { return mDisplayList; } + const DisplayList& getDisplayList() const { return mDisplayList; } + // TODO: can this be cleaned up? + DisplayList& getDisplayList() { return mDisplayList; } // Note: The position callbacks are relying on the listener using // the frameNumber to appropriately batch/synchronize these transactions. @@ -253,8 +255,8 @@ private: bool mNeedsDisplayListSync; // WARNING: Do not delete this directly, you must go through deleteDisplayList()! - DisplayList* mDisplayList; - DisplayList* mStagingDisplayList; + DisplayList mDisplayList; + DisplayList mStagingDisplayList; int64_t mDamageGenerationId; |