summaryrefslogtreecommitdiffstats
path: root/libs/hwui/OpenGLRenderer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libs/hwui/OpenGLRenderer.cpp')
-rwxr-xr-xlibs/hwui/OpenGLRenderer.cpp24
1 files changed, 19 insertions, 5 deletions
diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp
index f0adea9..ebcd1c6 100755
--- a/libs/hwui/OpenGLRenderer.cpp
+++ b/libs/hwui/OpenGLRenderer.cpp
@@ -283,21 +283,34 @@ void OpenGLRenderer::syncState() {
}
}
-void OpenGLRenderer::startTiling(const sp<Snapshot>& s, bool opaque) {
+void OpenGLRenderer::startTiling(const sp<Snapshot>& s, bool opaque, bool expand) {
if (!mSuppressTiling) {
Rect* clip = &mTilingClip;
if (s->flags & Snapshot::kFlagFboTarget) {
clip = &(s->layer->clipRect);
}
- startTiling(*clip, s->height, opaque);
+ startTiling(*clip, s->height, 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);
+ }
}
}
@@ -1003,7 +1016,8 @@ bool OpenGLRenderer::createFboLayer(Layer* layer, Rect& bounds, Rect& clip, GLui
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D,
layer->getTexture(), 0);
- startTiling(mSnapshot, true);
+ // Expand the startTiling region by 1
+ startTiling(mSnapshot, true, true);
// Clear the FBO, expand the clear region by 1 to get nice bilinear filtering
mCaches.enableScissor();