diff options
| author | Romain Guy <romainguy@google.com> | 2010-10-12 11:31:07 -0700 |
|---|---|---|
| committer | Romain Guy <romainguy@google.com> | 2010-10-12 11:31:07 -0700 |
| commit | c00972bb162779e52d1b0d8f662a9f6033bf9182 (patch) | |
| tree | 8ccf4a198e231998bc3c2eb75d3fc4d17cb0b2b3 /libs/hwui/OpenGLRenderer.cpp | |
| parent | 425c305a535d8c5a9082685523ba46d06199e543 (diff) | |
| download | frameworks_base-c00972bb162779e52d1b0d8f662a9f6033bf9182.zip frameworks_base-c00972bb162779e52d1b0d8f662a9f6033bf9182.tar.gz frameworks_base-c00972bb162779e52d1b0d8f662a9f6033bf9182.tar.bz2 | |
Don't recreate a new texture every time we draw a layer.
Change-Id: I3c28aff5acffc7c6f1ac74805869725426c62d28
Diffstat (limited to 'libs/hwui/OpenGLRenderer.cpp')
| -rw-r--r-- | libs/hwui/OpenGLRenderer.cpp | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp index 57de43a..cb23680 100644 --- a/libs/hwui/OpenGLRenderer.cpp +++ b/libs/hwui/OpenGLRenderer.cpp @@ -467,19 +467,14 @@ bool OpenGLRenderer::createLayer(sp<Snapshot> snapshot, float left, float top, // Copy the framebuffer into the layer glBindTexture(GL_TEXTURE_2D, layer->texture); - // TODO: Workaround for b/3054204 - glCopyTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, bounds.left, mHeight - bounds.bottom, - layer->width, layer->height, 0); - - // TODO: Waiting for b/3054204 to be fixed - // if (layer->empty) { - // glCopyTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, bounds.left, mHeight - bounds.bottom, - // layer->width, layer->height, 0); - // layer->empty = false; - // } else { - // glCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, bounds.left, mHeight - bounds.bottom, - // bounds.getWidth(), bounds.getHeight()); - // } + if (layer->empty) { + glCopyTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, bounds.left, mHeight - bounds.bottom, + layer->width, layer->height, 0); + layer->empty = false; + } else { + glCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, bounds.left, mHeight - bounds.bottom, + bounds.getWidth(), bounds.getHeight()); + } // Enqueue the buffer coordinates to clear the corresponding region later mLayers.push(new Rect(bounds)); |
