diff options
author | Romain Guy <romainguy@google.com> | 2011-12-14 19:23:32 -0800 |
---|---|---|
committer | Romain Guy <romainguy@google.com> | 2011-12-14 19:23:32 -0800 |
commit | 8f85e80b64b89fd38cc23b129f61ec36ddde7f15 (patch) | |
tree | bac2bd06357532f524277551c7606ad2471f7be8 /libs/hwui/OpenGLRenderer.cpp | |
parent | 2d4fd364843d3efc6e6ee59ccc5beb513a86d789 (diff) |
Generate even fewer GL commands
Change-Id: I0f4dcacb03ef5ee7f6ebd501df98bfead5f0a7f8
Diffstat (limited to 'libs/hwui/OpenGLRenderer.cpp')
-rw-r--r-- | libs/hwui/OpenGLRenderer.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp index cbfd77869c5d..75c6d0aebf49 100644 --- a/libs/hwui/OpenGLRenderer.cpp +++ b/libs/hwui/OpenGLRenderer.cpp @@ -155,7 +155,7 @@ void OpenGLRenderer::prepareDirty(float left, float top, float right, float bott mSaveCount = 1; glViewport(0, 0, mWidth, mHeight); - glScissor(left, mSnapshot->height - bottom, right - left, bottom - top); + mCaches.setScissor(left, mSnapshot->height - bottom, right - left, bottom - top); mSnapshot->setClip(left, top, right, bottom); mDirtyClip = false; @@ -550,7 +550,7 @@ bool OpenGLRenderer::createFboLayer(Layer* layer, Rect& bounds, sp<Snapshot> sna #endif // Clear the FBO, expand the clear region by 1 to get nice bilinear filtering - glScissor(clip.left - 1.0f, bounds.getHeight() - clip.bottom - 1.0f, + mCaches.setScissor(clip.left - 1.0f, bounds.getHeight() - clip.bottom - 1.0f, clip.getWidth() + 2.0f, clip.getHeight() + 2.0f); glClear(GL_COLOR_BUFFER_BIT); @@ -965,7 +965,10 @@ void OpenGLRenderer::concatMatrix(SkMatrix* matrix) { void OpenGLRenderer::setScissorFromClip() { Rect clip(*mSnapshot->clipRect); clip.snapToPixelBoundaries(); - glScissor(clip.left, mSnapshot->height - clip.bottom, clip.getWidth(), clip.getHeight()); + + mCaches.setScissor(clip.left, mSnapshot->height - clip.bottom, + clip.getWidth(), clip.getHeight()); + mDirtyClip = false; } |