diff options
author | 2014-12-10 17:05:43 -0800 | |
---|---|---|
committer | 2014-12-10 17:05:43 -0800 | |
commit | e2831a181f14dd6ca0e601a4c3cdc313a58faaae (patch) | |
tree | 62a964b423bcccd87cf9f25b732dcaf7f0b4956c | |
parent | 88daefb9485d0606ae0554514ae149bc97c7b4b7 (diff) | |
parent | 5369b76963a344d08fda4532227a6f0da28fd23a (diff) |
resolved conflicts for merge of 5369b769 to master
Change-Id: Iccb2ce948321534e05d67e64dc40a38332adb1a7
-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 f9cbf93099f3..6ec42c269329 100644 --- a/libs/hwui/AmbientShadow.cpp +++ b/libs/hwui/AmbientShadow.cpp @@ -326,6 +326,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 43dabdb1c60f..e168786b34ef 100644 --- a/libs/hwui/DisplayList.h +++ b/libs/hwui/DisplayList.h @@ -78,18 +78,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 b96bc0d16f0c..3304b2b29da8 100755 --- a/libs/hwui/OpenGLRenderer.cpp +++ b/libs/hwui/OpenGLRenderer.cpp @@ -314,6 +314,11 @@ bool 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 (onGetTargetFbo() == 0) { diff --git a/libs/hwui/OpenGLRenderer.h b/libs/hwui/OpenGLRenderer.h index fde9e0fb20ff..d3c35a8f5d7b 100755 --- a/libs/hwui/OpenGLRenderer.h +++ b/libs/hwui/OpenGLRenderer.h @@ -384,6 +384,12 @@ public: virtual void onSnapshotRestored(const Snapshot& removed, const Snapshot& restored); virtual GLuint onGetTargetFbo() const { return 0; } + SkPath* allocPathForFrame() { + SkPath* path = new SkPath(); + mTempPaths.push_back(path); + return path; + } + protected: /** * Perform the setup specific to a frame. This method does not @@ -1056,6 +1062,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; |