diff options
author | Chris Craik <ccraik@google.com> | 2013-08-26 11:23:46 -0700 |
---|---|---|
committer | Chris Craik <ccraik@google.com> | 2013-08-26 11:23:46 -0700 |
commit | 54f574acf4dd5483170b8f79e2f7c70b58763ce7 (patch) | |
tree | 8d97e104903d19019cb538fef06fac6597d384ba /libs | |
parent | 5bc1ea4e4ae0133d4d5eaa4ac98cf4719effd032 (diff) | |
download | frameworks_base-54f574acf4dd5483170b8f79e2f7c70b58763ce7.zip frameworks_base-54f574acf4dd5483170b8f79e2f7c70b58763ce7.tar.gz frameworks_base-54f574acf4dd5483170b8f79e2f7c70b58763ce7.tar.bz2 |
Move functor GL setup to just before functor
bug:10399469
Because the stencil setup can issue draws, it *must* come before the
GL state setup.
Change-Id: I52a36213549fc60b091a90cbb923a1f0d35f9a65
Diffstat (limited to 'libs')
-rw-r--r-- | libs/hwui/OpenGLRenderer.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp index f2352bb..238d9a4 100644 --- a/libs/hwui/OpenGLRenderer.cpp +++ b/libs/hwui/OpenGLRenderer.cpp @@ -449,14 +449,8 @@ status_t OpenGLRenderer::invokeFunctors(Rect& dirty) { status_t OpenGLRenderer::callDrawGLFunction(Functor* functor, Rect& dirty) { if (mSnapshot->isIgnored()) return DrawGlInfo::kStatusDone; - interrupt(); detachFunctor(functor); - mCaches.enableScissor(); - if (mDirtyClip) { - setScissorFromClip(); - setStencilFromClip(); - } Rect clip(*mSnapshot->clipRect); clip.snapToPixelBoundaries(); @@ -477,6 +471,15 @@ status_t OpenGLRenderer::callDrawGLFunction(Functor* functor, Rect& dirty) { info.height = getSnapshot()->height; getSnapshot()->transform->copyTo(&info.transform[0]); + // setup GL state for functor + if (mDirtyClip) { + setScissorFromClip(); + setStencilFromClip(); // can issue draws, so must precede enableScissor()/interrupt() + } + mCaches.enableScissor(); + interrupt(); + + // call functor immediately after GL state setup status_t result = (*functor)(DrawGlInfo::kModeDraw, &info); if (result != DrawGlInfo::kStatusDone) { |