From f5106847fc962d57c7d5c586099b4a382f3e1c3d Mon Sep 17 00:00:00 2001 From: Romain Guy Date: Fri, 14 Jan 2011 11:27:12 -0800 Subject: [PATCH] Don't add clipped rects to layer regions. Bug #3350208 Change-Id: I9266862f1d4d57b4598852e8dfa202b5f5099cce --- libs/hwui/OpenGLRenderer.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp index 98eb11eb11f78..f00557386bce4 100644 --- a/libs/hwui/OpenGLRenderer.cpp +++ b/libs/hwui/OpenGLRenderer.cpp @@ -697,12 +697,12 @@ void OpenGLRenderer::dirtyLayer(const float left, const float top, if ((mSnapshot->flags & Snapshot::kFlagFboTarget) && mSnapshot->region) { Rect bounds(left, top, right, bottom); transform.mapRect(bounds); - bounds.intersect(*mSnapshot->clipRect); - bounds.snapToPixelBoundaries(); - - android::Rect dirty(bounds.left, bounds.top, bounds.right, bounds.bottom); - if (!dirty.isEmpty()) { - mSnapshot->region->orSelf(dirty); + if (bounds.intersect(*mSnapshot->clipRect)) { + bounds.snapToPixelBoundaries(); + android::Rect dirty(bounds.left, bounds.top, bounds.right, bounds.bottom); + if (!dirty.isEmpty()) { + mSnapshot->region->orSelf(dirty); + } } } #endif @@ -713,12 +713,12 @@ void OpenGLRenderer::dirtyLayer(const float left, const float top, #if RENDER_LAYERS_AS_REGIONS if ((mSnapshot->flags & Snapshot::kFlagFboTarget) && mSnapshot->region) { Rect bounds(left, top, right, bottom); - bounds.intersect(*mSnapshot->clipRect); - bounds.snapToPixelBoundaries(); - - android::Rect dirty(bounds.left, bounds.top, bounds.right, bounds.bottom); - if (!dirty.isEmpty()) { - mSnapshot->region->orSelf(dirty); + if (bounds.intersect(*mSnapshot->clipRect)) { + bounds.snapToPixelBoundaries(); + android::Rect dirty(bounds.left, bounds.top, bounds.right, bounds.bottom); + if (!dirty.isEmpty()) { + mSnapshot->region->orSelf(dirty); + } } } #endif