Loading libs/hwui/OpenGLRenderer.cpp +13 −8 Original line number Diff line number Diff line Loading @@ -183,14 +183,7 @@ status_t OpenGLRenderer::prepareDirty(float left, float top, float right, float updateLayers(); // If we know that we are going to redraw the entire framebuffer, // perform a discard to let the driver know we don't need to preserve // the back buffer for this frame. if (mCaches.extensions.hasDiscardFramebuffer() && left <= 0.0f && top <= 0.0f && right >= mWidth && bottom >= mHeight) { const GLenum attachments[] = { getTargetFbo() == 0 ? GL_COLOR_EXT : GL_COLOR_ATTACHMENT0 }; glDiscardFramebufferEXT(GL_FRAMEBUFFER, 1, attachments); } discardFramebuffer(left, top, right, bottom); syncState(); Loading @@ -207,6 +200,18 @@ status_t OpenGLRenderer::prepareDirty(float left, float top, float right, float return clear(left, top, right, bottom, opaque); } void OpenGLRenderer::discardFramebuffer(float left, float top, float right, float bottom) { // If we know that we are going to redraw the entire framebuffer, // perform a discard to let the driver know we don't need to preserve // the back buffer for this frame. if (mCaches.extensions.hasDiscardFramebuffer() && left <= 0.0f && top <= 0.0f && right >= mWidth && bottom >= mHeight) { const GLenum attachments[] = { getTargetFbo() == 0 ? (const GLenum) GL_COLOR_EXT : (const GLenum) GL_COLOR_ATTACHMENT0 }; glDiscardFramebufferEXT(GL_FRAMEBUFFER, 1, attachments); } } status_t OpenGLRenderer::clear(float left, float top, float right, float bottom, bool opaque) { if (!opaque) { mCaches.enableScissor(); Loading libs/hwui/OpenGLRenderer.h +7 −0 Original line number Diff line number Diff line Loading @@ -365,6 +365,13 @@ protected: } private: /** * Discards the content of the framebuffer if supported by the driver. * This method should be called at the beginning of a frame to optimize * rendering on some tiler architectures. */ void discardFramebuffer(float left, float top, float right, float bottom); /** * Ensures the state of the renderer is the same as the state of * the GL context. Loading libs/hwui/SkiaShader.h +1 −1 File changed.Contains only whitespace changes. Show changes Loading
libs/hwui/OpenGLRenderer.cpp +13 −8 Original line number Diff line number Diff line Loading @@ -183,14 +183,7 @@ status_t OpenGLRenderer::prepareDirty(float left, float top, float right, float updateLayers(); // If we know that we are going to redraw the entire framebuffer, // perform a discard to let the driver know we don't need to preserve // the back buffer for this frame. if (mCaches.extensions.hasDiscardFramebuffer() && left <= 0.0f && top <= 0.0f && right >= mWidth && bottom >= mHeight) { const GLenum attachments[] = { getTargetFbo() == 0 ? GL_COLOR_EXT : GL_COLOR_ATTACHMENT0 }; glDiscardFramebufferEXT(GL_FRAMEBUFFER, 1, attachments); } discardFramebuffer(left, top, right, bottom); syncState(); Loading @@ -207,6 +200,18 @@ status_t OpenGLRenderer::prepareDirty(float left, float top, float right, float return clear(left, top, right, bottom, opaque); } void OpenGLRenderer::discardFramebuffer(float left, float top, float right, float bottom) { // If we know that we are going to redraw the entire framebuffer, // perform a discard to let the driver know we don't need to preserve // the back buffer for this frame. if (mCaches.extensions.hasDiscardFramebuffer() && left <= 0.0f && top <= 0.0f && right >= mWidth && bottom >= mHeight) { const GLenum attachments[] = { getTargetFbo() == 0 ? (const GLenum) GL_COLOR_EXT : (const GLenum) GL_COLOR_ATTACHMENT0 }; glDiscardFramebufferEXT(GL_FRAMEBUFFER, 1, attachments); } } status_t OpenGLRenderer::clear(float left, float top, float right, float bottom, bool opaque) { if (!opaque) { mCaches.enableScissor(); Loading
libs/hwui/OpenGLRenderer.h +7 −0 Original line number Diff line number Diff line Loading @@ -365,6 +365,13 @@ protected: } private: /** * Discards the content of the framebuffer if supported by the driver. * This method should be called at the beginning of a frame to optimize * rendering on some tiler architectures. */ void discardFramebuffer(float left, float top, float right, float bottom); /** * Ensures the state of the renderer is the same as the state of * the GL context. Loading