am 152d9e61: Merge "[HWUI]: fix residual line on FrameBuffer"

* commit '152d9e61284d31e3b9dfa8dccca3c3c78382035d':
  [HWUI]: fix residual line on FrameBuffer
This commit is contained in:
Chris Craik
2014-07-17 19:32:08 +00:00
committed by Android Git Automerger
2 changed files with 21 additions and 7 deletions

24
libs/hwui/OpenGLRenderer.cpp Normal file → Executable file
View File

@@ -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) { if (!mSuppressTiling) {
Rect* clip = &mTilingClip; Rect* clip = &mTilingClip;
if (s->flags & Snapshot::kFlagFboTarget) { if (s->flags & Snapshot::kFlagFboTarget) {
clip = &(s->layer->clipRect); 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) { 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); 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, glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D,
layer->getTexture(), 0); 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 // Clear the FBO, expand the clear region by 1 to get nice bilinear filtering
mCaches.enableScissor(); mCaches.enableScissor();

4
libs/hwui/OpenGLRenderer.h Normal file → Executable file
View File

@@ -587,14 +587,14 @@ private:
* This method needs to be invoked every time getTargetFbo() is * This method needs to be invoked every time getTargetFbo() is
* bound again. * bound again.
*/ */
void startTiling(const sp<Snapshot>& snapshot, bool opaque = false); void startTiling(const sp<Snapshot>& snapshot, bool opaque = false, bool expand = false);
/** /**
* Tells the GPU what part of the screen is about to be redrawn. * Tells the GPU what part of the screen is about to be redrawn.
* This method needs to be invoked every time getTargetFbo() is * This method needs to be invoked every time getTargetFbo() is
* bound again. * 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 * Tells the GPU that we are done drawing the frame or that we