summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libs/renderengine/gl/filters/BlurFilter.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/libs/renderengine/gl/filters/BlurFilter.cpp b/libs/renderengine/gl/filters/BlurFilter.cpp
index b139e4b3c5..2e80c62253 100644
--- a/libs/renderengine/gl/filters/BlurFilter.cpp
+++ b/libs/renderengine/gl/filters/BlurFilter.cpp
@@ -31,6 +31,9 @@ namespace android {
namespace renderengine {
namespace gl {
+// This needs to be located in .rodata to get a pointer for the OpenGL API.
+static const GLenum kInvalidateAttachment = GL_COLOR_ATTACHMENT0;
+
BlurFilter::BlurFilter(GLESRenderEngine& engine)
: mEngine(engine),
mCompositionFbo(engine),
@@ -122,6 +125,7 @@ status_t BlurFilter::setAsDrawTarget(const DisplaySettings& display, uint32_t ra
}
mCompositionFbo.bind();
+ glInvalidateFramebuffer(GL_FRAMEBUFFER, 1, &kInvalidateAttachment);
glViewport(0, 0, mCompositionFbo.getBufferWidth(), mCompositionFbo.getBufferHeight());
return NO_ERROR;
}
@@ -151,6 +155,7 @@ status_t BlurFilter::prepare() {
GLFramebuffer* draw = &mPingFbo;
read->bindAsReadBuffer();
draw->bindAsDrawBuffer();
+ glInvalidateFramebuffer(GL_FRAMEBUFFER, 1, &kInvalidateAttachment);
glBlitFramebuffer(0, 0,
read->getBufferWidth(), read->getBufferHeight(),
0, 0,
@@ -161,6 +166,7 @@ status_t BlurFilter::prepare() {
// And now we'll ping pong between our textures, to accumulate the result of various offsets.
mBlurProgram.useProgram();
+ glInvalidateFramebuffer(GL_FRAMEBUFFER, 1, &kInvalidateAttachment);
glViewport(0, 0, draw->getBufferWidth(), draw->getBufferHeight());
for (auto i = 1; i < passes; i++) {
ATRACE_NAME("BlurFilter::renderPass");