diff options
Diffstat (limited to 'libs')
| -rw-r--r-- | libs/hwui/TessellationCache.cpp | 29 | ||||
| -rw-r--r-- | libs/hwui/renderthread/RenderProxy.cpp | 2 |
2 files changed, 18 insertions, 13 deletions
diff --git a/libs/hwui/TessellationCache.cpp b/libs/hwui/TessellationCache.cpp index 41cc9d2..79fe4d3 100644 --- a/libs/hwui/TessellationCache.cpp +++ b/libs/hwui/TessellationCache.cpp @@ -165,12 +165,12 @@ public: ShadowTask(const Matrix4* drawTransform, const Rect& localClip, bool opaque, const SkPath* casterPerimeter, const Matrix4* transformXY, const Matrix4* transformZ, const Vector3& lightCenter, float lightRadius) - : drawTransform(drawTransform) + : drawTransform(*drawTransform) , localClip(localClip) , opaque(opaque) - , casterPerimeter(casterPerimeter) - , transformXY(transformXY) - , transformZ(transformZ) + , casterPerimeter(*casterPerimeter) + , transformXY(*transformXY) + , transformZ(*transformZ) , lightCenter(lightCenter) , lightRadius(lightRadius) { } @@ -182,14 +182,19 @@ public: delete bufferPair; } - // Note - only the localClip is deep copied, since other pointers point at Allocator controlled - // objects, which are safe for the entire frame - const Matrix4* drawTransform; + /* Note - we deep copy all task parameters, because *even though* pointers into Allocator + * controlled objects (like the SkPath and Matrix4s) should be safe for the entire frame, + * certain Allocators are destroyed before trim() is called to flush incomplete tasks. + * + * These deep copies could be avoided, long term, by cancelling or flushing outstanding tasks + * before tearning down single-frame LinearAllocators. + */ + const Matrix4 drawTransform; const Rect localClip; bool opaque; - const SkPath* casterPerimeter; - const Matrix4* transformXY; - const Matrix4* transformZ; + const SkPath casterPerimeter; + const Matrix4 transformXY; + const Matrix4 transformZ; const Vector3 lightCenter; const float lightRadius; }; @@ -281,8 +286,8 @@ public: VertexBuffer* ambientBuffer = new VertexBuffer; VertexBuffer* spotBuffer = new VertexBuffer; - tessellateShadows(t->drawTransform, &t->localClip, t->opaque, t->casterPerimeter, - t->transformXY, t->transformZ, t->lightCenter, t->lightRadius, + tessellateShadows(&t->drawTransform, &t->localClip, t->opaque, &t->casterPerimeter, + &t->transformXY, &t->transformZ, t->lightCenter, t->lightRadius, *ambientBuffer, *spotBuffer); t->setResult(new TessellationCache::vertexBuffer_pair_t(ambientBuffer, spotBuffer)); diff --git a/libs/hwui/renderthread/RenderProxy.cpp b/libs/hwui/renderthread/RenderProxy.cpp index ded10a1..4988f19 100644 --- a/libs/hwui/renderthread/RenderProxy.cpp +++ b/libs/hwui/renderthread/RenderProxy.cpp @@ -47,7 +47,7 @@ namespace renderthread { #define SETUP_TASK(method) \ LOG_ALWAYS_FATAL_IF( METHOD_INVOKE_PAYLOAD_SIZE < sizeof(ARGS(method)), \ - "METHOD_INVOKE_PAYLOAD_SIZE %d is smaller than sizeof(" #method "Args) %d", \ + "METHOD_INVOKE_PAYLOAD_SIZE %zu is smaller than sizeof(" #method "Args) %zu", \ METHOD_INVOKE_PAYLOAD_SIZE, sizeof(ARGS(method))); \ MethodInvokeRenderTask* task = new MethodInvokeRenderTask((RunnableMethod) Bridge_ ## method); \ ARGS(method) *args = (ARGS(method) *) task->payload() |
