summaryrefslogtreecommitdiffstats
path: root/libs/hwui/DisplayListOp.h
diff options
context:
space:
mode:
authorChris Craik <ccraik@google.com>2014-06-02 16:27:04 -0700
committerChris Craik <ccraik@google.com>2014-06-10 01:53:17 +0000
commit05f3d6e5111fd08df5cd9aae2c3d28399dc0e7f5 (patch)
tree14df3cad82b02a886b8e3a04fd4ec249e1d403e4 /libs/hwui/DisplayListOp.h
parentfaecafce62ca39a7693669f7c9eabf2d71c633cf (diff)
downloadframeworks_base-05f3d6e5111fd08df5cd9aae2c3d28399dc0e7f5.zip
frameworks_base-05f3d6e5111fd08df5cd9aae2c3d28399dc0e7f5.tar.gz
frameworks_base-05f3d6e5111fd08df5cd9aae2c3d28399dc0e7f5.tar.bz2
Tessellate on worker threads
Tessellate and cache (where possible) shadow and round rect tessellation tasks. Change-Id: I2cfda8e11d83d51ea74af871235cf26e8f831d40
Diffstat (limited to 'libs/hwui/DisplayListOp.h')
-rw-r--r--libs/hwui/DisplayListOp.h29
1 files changed, 27 insertions, 2 deletions
diff --git a/libs/hwui/DisplayListOp.h b/libs/hwui/DisplayListOp.h
index ea3e7a8..3281116 100644
--- a/libs/hwui/DisplayListOp.h
+++ b/libs/hwui/DisplayListOp.h
@@ -1114,6 +1114,15 @@ public:
OP_LOG("Draw RoundRect "RECT_STRING", rx %f, ry %f", RECT_ARGS(mLocalBounds), mRx, mRy);
}
+ virtual void onDefer(OpenGLRenderer& renderer, DeferInfo& deferInfo,
+ const DeferredDisplayState& state) {
+ DrawStrokableOp::onDefer(renderer, deferInfo, state);
+ if (!mPaint->getPathEffect()) {
+ renderer.getCaches().tessellationCache.precacheRoundRect(state.mMatrix,
+ mLocalBounds.getWidth(), mLocalBounds.getHeight(), mRx, mRy, mPaint);
+ }
+ }
+
virtual const char* name() { return "DrawRoundRect"; }
private:
@@ -1533,9 +1542,23 @@ public:
}
}
+ virtual void onDefer(OpenGLRenderer& renderer, DeferInfo& deferInfo,
+ const DeferredDisplayState& state) {
+ renderer.getCaches().tessellationCache.precacheShadows(&state.mMatrix,
+ renderer.getLocalClipBounds(), isCasterOpaque(), &mOutline,
+ &mTransformXY, &mTransformZ, renderer.getLightCenter(), renderer.getLightRadius());
+ }
+
virtual status_t applyDraw(OpenGLRenderer& renderer, Rect& dirty) {
- return renderer.drawShadow(mTransformXY, mTransformZ,
- mCasterAlpha, mCasterUnclipped, &mOutline);
+ TessellationCache::vertexBuffer_pair_t buffers;
+ Matrix4 drawTransform;
+ renderer.getMatrix(&drawTransform);
+ renderer.getCaches().tessellationCache.getShadowBuffers(&drawTransform,
+ renderer.getLocalClipBounds(), isCasterOpaque(), &mOutline,
+ &mTransformXY, &mTransformZ, renderer.getLightCenter(), renderer.getLightRadius(),
+ buffers);
+
+ return renderer.drawShadow(mCasterAlpha, buffers.first, buffers.second);
}
virtual void output(int level, uint32_t logFlags) const {
@@ -1545,6 +1568,8 @@ public:
virtual const char* name() { return "DrawShadow"; }
private:
+ bool isCasterOpaque() { return mCasterAlpha >= 1.0f && mCasterUnclipped; }
+
const mat4 mTransformXY;
const mat4 mTransformZ;
const float mCasterAlpha;