summaryrefslogtreecommitdiffstats
path: root/libs
diff options
context:
space:
mode:
authorRomain Guy <romainguy@google.com>2012-04-03 19:30:26 -0700
committerRomain Guy <romainguy@google.com>2012-04-03 19:30:26 -0700
commite0aa84b7dc087e999e20055dcc04cb6a48d5bd62 (patch)
tree1aebdbebe17e17239231c890710b5b1c9c0ac4ae /libs
parent5c88fc744db977ef26887df9605beaa409394806 (diff)
downloadframeworks_base-e0aa84b7dc087e999e20055dcc04cb6a48d5bd62.zip
frameworks_base-e0aa84b7dc087e999e20055dcc04cb6a48d5bd62.tar.gz
frameworks_base-e0aa84b7dc087e999e20055dcc04cb6a48d5bd62.tar.bz2
Optimize FBOs composition
Change-Id: Ifc8eada8922509373c0e4c3b2ed75b6f08d098de
Diffstat (limited to 'libs')
-rw-r--r--libs/hwui/OpenGLRenderer.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp
index e4d1ba9..9000391 100644
--- a/libs/hwui/OpenGLRenderer.cpp
+++ b/libs/hwui/OpenGLRenderer.cpp
@@ -594,6 +594,9 @@ void OpenGLRenderer::composeLayer(sp<Snapshot> current, sp<Snapshot> previous) {
const bool fboLayer = current->flags & Snapshot::kFlagIsFboLayer;
if (fboLayer) {
+ // Detach the texture from the FBO
+ glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, 0, 0);
+
// Unbind current FBO and restore previous one
glBindFramebuffer(GL_FRAMEBUFFER, previous->fbo);
}
@@ -634,11 +637,6 @@ void OpenGLRenderer::composeLayer(sp<Snapshot> current, sp<Snapshot> previous) {
// code path
// See LayerRenderer::destroyLayer(Layer*)
- // Detach the texture from the FBO
- glBindFramebuffer(GL_FRAMEBUFFER, current->fbo);
- glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, 0, 0);
- glBindFramebuffer(GL_FRAMEBUFFER, previous->fbo);
-
// Put the FBO name back in the cache, if it doesn't fit, it will be destroyed
mCaches.fboCache.put(current->fbo);
layer->setFbo(0);