diff options
author | Chris Craik <ccraik@google.com> | 2014-12-10 15:23:54 -0800 |
---|---|---|
committer | Chris Craik <ccraik@google.com> | 2014-12-10 15:23:54 -0800 |
commit | 5369b76963a344d08fda4532227a6f0da28fd23a (patch) | |
tree | 9cc8519749be8ddff2f0f1d4c4fe7a1457c80fcd /libs | |
parent | 16d73a752e9ee937c39be4ce2da5411cf1af0c5c (diff) | |
parent | ed211b940b24231d02c4e6e2757ee02ff1b9ea79 (diff) | |
download | frameworks_base-5369b76963a344d08fda4532227a6f0da28fd23a.zip frameworks_base-5369b76963a344d08fda4532227a6f0da28fd23a.tar.gz frameworks_base-5369b76963a344d08fda4532227a6f0da28fd23a.tar.bz2 |
resolve merge conflicts of ed211b9 to lmp-mr1-dev-plus-aosp.
Change-Id: Ib9d6d301282bbaae6b23b9ce07b9e6a4e9075991
Diffstat (limited to 'libs')
-rw-r--r-- | libs/hwui/AmbientShadow.cpp | 1 | ||||
-rw-r--r-- | libs/hwui/DisplayList.h | 12 | ||||
-rwxr-xr-x | libs/hwui/OpenGLRenderer.cpp | 5 | ||||
-rwxr-xr-x | libs/hwui/OpenGLRenderer.h | 9 |
4 files changed, 19 insertions, 8 deletions
diff --git a/libs/hwui/AmbientShadow.cpp b/libs/hwui/AmbientShadow.cpp index 13de0a6..5840107 100644 --- a/libs/hwui/AmbientShadow.cpp +++ b/libs/hwui/AmbientShadow.cpp @@ -325,6 +325,7 @@ void AmbientShadow::createAmbientShadow(bool isCasterOpaque, // At the end, update the real index and vertex buffer size. shadowVertexBuffer.updateVertexCount(vertexBufferIndex); shadowVertexBuffer.updateIndexCount(indexBufferIndex); + shadowVertexBuffer.computeBounds<AlphaVertex>(); ShadowTessellator::checkOverflow(vertexBufferIndex, totalVertexCount, "Ambient Vertex Buffer"); ShadowTessellator::checkOverflow(indexBufferIndex, totalIndexCount, "Ambient Index Buffer"); diff --git a/libs/hwui/DisplayList.h b/libs/hwui/DisplayList.h index e15adf3..a9a9148 100644 --- a/libs/hwui/DisplayList.h +++ b/libs/hwui/DisplayList.h @@ -77,18 +77,14 @@ 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 + // 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() { - mTempPaths.push_back(SkPath()); - return &mTempPaths.back(); + return mRenderer.allocPathForFrame(); } - -private: - // Paths kept alive for the duration of the frame - std::vector<SkPath> mTempPaths; }; struct DeferStateStruct : public PlaybackStateStruct { diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp index 86821e8..661e138 100755 --- a/libs/hwui/OpenGLRenderer.cpp +++ b/libs/hwui/OpenGLRenderer.cpp @@ -311,6 +311,11 @@ void OpenGLRenderer::finish() { renderOverdraw(); endTiling(); + for (size_t i = 0; i < mTempPaths.size(); i++) { + delete mTempPaths[i]; + } + mTempPaths.clear(); + // When finish() is invoked on FBO 0 we've reached the end // of the current frame if (getTargetFbo() == 0) { diff --git a/libs/hwui/OpenGLRenderer.h b/libs/hwui/OpenGLRenderer.h index e1c3d10..5eee2e2 100755 --- a/libs/hwui/OpenGLRenderer.h +++ b/libs/hwui/OpenGLRenderer.h @@ -342,6 +342,12 @@ public: uint8_t getAmbientShadowAlpha() const { return mAmbientShadowAlpha; } uint8_t getSpotShadowAlpha() const { return mSpotShadowAlpha; } + SkPath* allocPathForFrame() { + SkPath* path = new SkPath(); + mTempPaths.push_back(path); + return path; + } + protected: /** * Perform the setup specific to a frame. This method does not @@ -1014,6 +1020,9 @@ private: uint8_t mAmbientShadowAlpha; uint8_t mSpotShadowAlpha; + // Paths kept alive for the duration of the frame + std::vector<SkPath*> mTempPaths; + friend class Layer; friend class TextSetupFunctor; friend class DrawBitmapOp; |