diff options
Diffstat (limited to 'libs/hwui/DisplayList.h')
-rw-r--r-- | libs/hwui/DisplayList.h | 69 |
1 files changed, 3 insertions, 66 deletions
diff --git a/libs/hwui/DisplayList.h b/libs/hwui/DisplayList.h index ccf71c6d360b..a8205c854c14 100644 --- a/libs/hwui/DisplayList.h +++ b/libs/hwui/DisplayList.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef ANDROID_HWUI_DISPLAY_LIST_H -#define ANDROID_HWUI_DISPLAY_LIST_H +#pragma once #include <SkCamera.h> #include <SkMatrix.h> @@ -34,7 +33,6 @@ #include "Debug.h" #include "CanvasProperty.h" -#include "DeferredDisplayList.h" #include "GlFunctorLifecycleListener.h" #include "Matrix.h" #include "RenderProperties.h" @@ -49,72 +47,20 @@ class SkRegion; namespace android { namespace uirenderer { -class DeferredDisplayList; -class DisplayListOp; -class DisplayListCanvas; -class OpenGLRenderer; class Rect; class Layer; -#if HWUI_NEW_OPS struct RecordedOp; struct RenderNodeOp; typedef RecordedOp BaseOpType; typedef RenderNodeOp NodeOpType; -#else -class DrawRenderNodeOp; - -typedef DisplayListOp BaseOpType; -typedef DrawRenderNodeOp NodeOpType; -#endif namespace VectorDrawable { class Tree; }; typedef uirenderer::VectorDrawable::Tree VectorDrawableRoot; -/** - * Holds data used in the playback a tree of DisplayLists. - */ -struct PlaybackStateStruct { -protected: - PlaybackStateStruct(OpenGLRenderer& renderer, int replayFlags, LinearAllocator* allocator) - : mRenderer(renderer) - , mReplayFlags(replayFlags) - , mAllocator(allocator) {} - -public: - OpenGLRenderer& mRenderer; - const int mReplayFlags; - - // Allocator with the lifetime of a single frame. replay uses an Allocator owned by the struct, - // while defer shares the DeferredDisplayList's Allocator - // TODO: move this allocator to be owned by object with clear frame lifecycle - LinearAllocator * const mAllocator; - - SkPath* allocPathForFrame() { - return mRenderer.allocPathForFrame(); - } -}; - -struct DeferStateStruct : public PlaybackStateStruct { - DeferStateStruct(DeferredDisplayList& deferredList, OpenGLRenderer& renderer, int replayFlags) - : PlaybackStateStruct(renderer, replayFlags, &(deferredList.mAllocator)), - mDeferredList(deferredList) {} - - DeferredDisplayList& mDeferredList; -}; - -struct ReplayStateStruct : public PlaybackStateStruct { - ReplayStateStruct(OpenGLRenderer& renderer, Rect& dirty, int replayFlags) - : PlaybackStateStruct(renderer, replayFlags, &mReplayAllocator), - mDirty(dirty) {} - - Rect& mDirty; - LinearAllocator mReplayAllocator; -}; - struct FunctorContainer { Functor* functor; GlFunctorLifecycleListener* listener; @@ -124,7 +70,6 @@ struct FunctorContainer { * Data structure that holds the list of commands used in display list stream */ class DisplayList { - friend class DisplayListCanvas; friend class RecordingCanvas; public: struct Chunk { @@ -138,9 +83,9 @@ public: // whether children with non-zero Z in the chunk should be reordered bool reorderChildren; -#if HWUI_NEW_OPS + + // clip at the beginning of a reorder section, applied to reordered children const ClipBase* reorderClip; -#endif }; DisplayList(); @@ -169,11 +114,7 @@ public: return allocator.usedSize(); } bool isEmpty() { -#if HWUI_NEW_OPS return ops.empty(); -#else - return !hasDrawOps; -#endif } private: @@ -203,12 +144,8 @@ private: // gets special treatment exclusive for webview. LsaVector<VectorDrawableRoot*> vectorDrawables; - bool hasDrawOps; // only used if !HWUI_NEW_OPS - void cleanupResources(); }; }; // namespace uirenderer }; // namespace android - -#endif // ANDROID_HWUI_OPENGL_RENDERER_H |