From 8f85e80b64b89fd38cc23b129f61ec36ddde7f15 Mon Sep 17 00:00:00 2001 From: Romain Guy Date: Wed, 14 Dec 2011 19:23:32 -0800 Subject: Generate even fewer GL commands Change-Id: I0f4dcacb03ef5ee7f6ebd501df98bfead5f0a7f8 --- libs/hwui/OpenGLRenderer.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'libs/hwui/OpenGLRenderer.cpp') 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 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; } -- cgit v1.2.3-59-g8ed1b