diff options
author | 2011-01-24 16:33:45 -0800 | |
---|---|---|
committer | 2011-01-24 18:39:56 -0800 | |
commit | 7d7b5490a0b0763e831b31bc11f17d8159b5914a (patch) | |
tree | 7326e41a76618cba25a9757b43db779a607b9bdf /libs/hwui/OpenGLRenderer.cpp | |
parent | 3dd0908a65095cb6946001ae3039ab87a47b4f33 (diff) |
Enable partial invalidates when rendering with OpenGL.
Change-Id: Ie8be06c4776b815e8737753eb8003b4fd8936130
Diffstat (limited to 'libs/hwui/OpenGLRenderer.cpp')
-rw-r--r-- | libs/hwui/OpenGLRenderer.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp index 98f8fc5e73f6..d343a6f8aaf6 100644 --- a/libs/hwui/OpenGLRenderer.cpp +++ b/libs/hwui/OpenGLRenderer.cpp @@ -136,6 +136,10 @@ void OpenGLRenderer::setViewport(int width, int height) { } void OpenGLRenderer::prepare(bool opaque) { + prepareDirty(0.0f, 0.0f, mWidth, mHeight, opaque); +} + +void OpenGLRenderer::prepareDirty(float left, float top, float right, float bottom, bool opaque) { mCaches.clearGarbage(); mSnapshot = new Snapshot(mFirstSnapshot, @@ -146,15 +150,14 @@ void OpenGLRenderer::prepare(bool opaque) { glDisable(GL_DITHER); + glEnable(GL_SCISSOR_TEST); + glScissor(left, mSnapshot->height - bottom, right - left, bottom - top); + mSnapshot->setClip(left, top, right, bottom); + if (!opaque) { - glDisable(GL_SCISSOR_TEST); glClearColor(0.0f, 0.0f, 0.0f, 0.0f); glClear(GL_COLOR_BUFFER_BIT); } - - glEnable(GL_SCISSOR_TEST); - glScissor(0, 0, mWidth, mHeight); - mSnapshot->setClip(0.0f, 0.0f, mWidth, mHeight); } void OpenGLRenderer::finish() { |