summaryrefslogtreecommitdiffstats
path: root/libs
diff options
context:
space:
mode:
authorChris Craik <ccraik@google.com>2014-07-17 22:38:57 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-07-17 18:11:21 +0000
commitf3e85b5bac693780c75935f0d27acf536458702d (patch)
tree40a5ecda728a38fdf3083c59413b077b07000d65 /libs
parentc7a845de4a9578e8093b6abcb90c6836d360d5b3 (diff)
parent33f5a59ac3e304970920dda824958870f85f76ef (diff)
downloadframeworks_base-f3e85b5bac693780c75935f0d27acf536458702d.zip
frameworks_base-f3e85b5bac693780c75935f0d27acf536458702d.tar.gz
frameworks_base-f3e85b5bac693780c75935f0d27acf536458702d.tar.bz2
Merge "[HWUI]: fix residual line on FrameBuffer" into lmp-dev
Diffstat (limited to 'libs')
-rwxr-xr-x[-rw-r--r--]libs/hwui/OpenGLRenderer.cpp24
-rwxr-xr-x[-rw-r--r--]libs/hwui/OpenGLRenderer.h4
2 files changed, 21 insertions, 7 deletions
diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp
index e468a75..5a96132 100644..100755
--- a/libs/hwui/OpenGLRenderer.cpp
+++ b/libs/hwui/OpenGLRenderer.cpp
@@ -259,7 +259,7 @@ void OpenGLRenderer::syncState() {
}
}
-void OpenGLRenderer::startTilingCurrentClip(bool opaque) {
+void OpenGLRenderer::startTilingCurrentClip(bool opaque, bool expand) {
if (!mSuppressTiling) {
const Snapshot* snapshot = currentSnapshot();
@@ -268,14 +268,27 @@ void OpenGLRenderer::startTilingCurrentClip(bool opaque) {
clip = &(snapshot->layer->clipRect);
}
- startTiling(*clip, getViewportHeight(), opaque);
+ startTiling(*clip, getViewportHeight(), opaque, expand);
}
}
-void OpenGLRenderer::startTiling(const Rect& clip, int windowHeight, bool opaque) {
+void OpenGLRenderer::startTiling(const Rect& clip, int windowHeight, bool opaque, bool expand) {
if (!mSuppressTiling) {
- mCaches.startTiling(clip.left, windowHeight - clip.bottom,
+ if(expand) {
+ // Expand the startTiling region by 1
+ int leftNotZero = (clip.left > 0) ? 1 : 0;
+ int topNotZero = (windowHeight - clip.bottom > 0) ? 1 : 0;
+
+ mCaches.startTiling(
+ clip.left - leftNotZero,
+ windowHeight - clip.bottom - topNotZero,
+ clip.right - clip.left + leftNotZero + 1,
+ clip.bottom - clip.top + topNotZero + 1,
+ opaque);
+ } else {
+ mCaches.startTiling(clip.left, windowHeight - clip.bottom,
clip.right - clip.left, clip.bottom - clip.top, opaque);
+ }
}
}
@@ -821,7 +834,8 @@ bool OpenGLRenderer::createFboLayer(Layer* layer, Rect& bounds, Rect& clip) {
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D,
layer->getTexture(), 0);
- startTilingCurrentClip(true);
+ // Expand the startTiling region by 1
+ startTilingCurrentClip(true, true);
// Clear the FBO, expand the clear region by 1 to get nice bilinear filtering
mCaches.enableScissor();
diff --git a/libs/hwui/OpenGLRenderer.h b/libs/hwui/OpenGLRenderer.h
index e7328be..4e7844b 100644..100755
--- a/libs/hwui/OpenGLRenderer.h
+++ b/libs/hwui/OpenGLRenderer.h
@@ -491,14 +491,14 @@ private:
* This method needs to be invoked every time getTargetFbo() is
* bound again.
*/
- void startTilingCurrentClip(bool opaque = false);
+ void startTilingCurrentClip(bool opaque = false, bool expand = false);
/**
* Tells the GPU what part of the screen is about to be redrawn.
* This method needs to be invoked every time getTargetFbo() is
* bound again.
*/
- void startTiling(const Rect& clip, int windowHeight, bool opaque = false);
+ void startTiling(const Rect& clip, int windowHeight, bool opaque = false, bool expand = false);
/**
* Tells the GPU that we are done drawing the frame or that we