From 7077506f9945b87b02bdd47ffce75a5b813c821c Mon Sep 17 00:00:00 2001 From: Dave Burke Date: Mon, 14 Nov 2011 11:39:30 -0800 Subject: Revert "Discard framebuffer rendering queues when discarding layers" This reverts commit da96f8ac2c1c35a54f3f36e6d776cb386a251d03. --- libs/hwui/Android.mk | 2 +- libs/hwui/Extensions.h | 3 --- libs/hwui/LayerRenderer.cpp | 26 ++------------------------ libs/hwui/LayerRenderer.h | 1 - libs/hwui/OpenGLRenderer.cpp | 5 ----- 5 files changed, 3 insertions(+), 34 deletions(-) (limited to 'libs') diff --git a/libs/hwui/Android.mk b/libs/hwui/Android.mk index 95e0a18..9bfc94c 100644 --- a/libs/hwui/Android.mk +++ b/libs/hwui/Android.mk @@ -38,7 +38,7 @@ ifeq ($(USE_OPENGL_RENDERER),true) external/skia/src/ports \ external/skia/include/utils - LOCAL_CFLAGS += -DUSE_OPENGL_RENDERER -DGL_GLEXT_PROTOTYPES + LOCAL_CFLAGS += -DUSE_OPENGL_RENDERER LOCAL_CFLAGS += -fvisibility=hidden LOCAL_MODULE_CLASS := SHARED_LIBRARIES LOCAL_SHARED_LIBRARIES := libcutils libutils libGLESv2 libskia libui diff --git a/libs/hwui/Extensions.h b/libs/hwui/Extensions.h index 48e4247..38d1130 100644 --- a/libs/hwui/Extensions.h +++ b/libs/hwui/Extensions.h @@ -66,7 +66,6 @@ public: mHasNPot = hasExtension("GL_OES_texture_npot"); mHasFramebufferFetch = hasExtension("GL_NV_shader_framebuffer_fetch"); - mHasDiscardFramebuffer = hasExtension("GL_EXT_discard_framebuffer"); const char* vendor = (const char*) glGetString(GL_VENDOR); EXT_LOGD("Vendor: %s", vendor); @@ -81,7 +80,6 @@ public: inline bool hasNPot() const { return mHasNPot; } inline bool hasFramebufferFetch() const { return mHasFramebufferFetch; } inline bool needsHighpTexCoords() const { return mNeedsHighpTexCoords; } - inline bool hasDiscardFramebuffer() const { return mHasDiscardFramebuffer; } bool hasExtension(const char* extension) const { const String8 s(extension); @@ -100,7 +98,6 @@ private: bool mHasNPot; bool mNeedsHighpTexCoords; bool mHasFramebufferFetch; - bool mHasDiscardFramebuffer; }; // class Extensions }; // namespace uirenderer diff --git a/libs/hwui/LayerRenderer.cpp b/libs/hwui/LayerRenderer.cpp index b7c079b..e38b479 100644 --- a/libs/hwui/LayerRenderer.cpp +++ b/libs/hwui/LayerRenderer.cpp @@ -305,10 +305,8 @@ void LayerRenderer::destroyLayer(Layer* layer) { LAYER_RENDERER_LOGD("Recycling layer, %dx%d fbo = %d", layer->getWidth(), layer->getHeight(), layer->getFbo()); - GLuint fbo = layer->getFbo(); - if (fbo) { - flushLayer(layer); - Caches::getInstance().fboCache.put(fbo); + if (layer->getFbo()) { + Caches::getInstance().fboCache.put(layer->getFbo()); } if (!Caches::getInstance().layerCache.put(layer)) { @@ -333,26 +331,6 @@ void LayerRenderer::destroyLayerDeferred(Layer* layer) { } } -void LayerRenderer::flushLayer(Layer* layer) { -#ifdef GL_EXT_discard_framebuffer - GLuint fbo = layer->getFbo(); - if (layer && fbo) { - // If possible, discard any enqued operations on deferred - // rendering architectures - if (Caches::getInstance().extensions.hasDiscardFramebuffer()) { - GLuint previousFbo; - glGetIntegerv(GL_FRAMEBUFFER_BINDING, (GLint*) &previousFbo); - - GLenum attachments = GL_COLOR_ATTACHMENT0; - glBindFramebuffer(GL_FRAMEBUFFER, fbo); - glDiscardFramebufferEXT(GL_FRAMEBUFFER, 1, &attachments); - - glBindFramebuffer(GL_FRAMEBUFFER, previousFbo); - } - } -#endif -} - bool LayerRenderer::copyLayer(Layer* layer, SkBitmap* bitmap) { Caches& caches = Caches::getInstance(); if (layer && layer->isTextureLayer() && bitmap->width() <= caches.maxTextureSize && diff --git a/libs/hwui/LayerRenderer.h b/libs/hwui/LayerRenderer.h index 72d8d81..6104301 100644 --- a/libs/hwui/LayerRenderer.h +++ b/libs/hwui/LayerRenderer.h @@ -61,7 +61,6 @@ public: bool isOpaque, GLenum renderTarget, float* transform); ANDROID_API static void destroyLayer(Layer* layer); ANDROID_API static void destroyLayerDeferred(Layer* layer); - ANDROID_API static void flushLayer(Layer* layer); ANDROID_API static bool copyLayer(Layer* layer, SkBitmap* bitmap); private: diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp index 1a8c199..32595e4 100644 --- a/libs/hwui/OpenGLRenderer.cpp +++ b/libs/hwui/OpenGLRenderer.cpp @@ -611,11 +611,6 @@ void OpenGLRenderer::composeLayer(sp current, sp previous) { } if (fboLayer) { - // Note: No need to use glDiscardFramebufferEXT() since we never - // create/compose layers that are not on screen with this - // 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); -- cgit v1.1