From 32f05e343c5ffb17f3235942bcda651bd3b9f1d6 Mon Sep 17 00:00:00 2001 From: Chris Craik Date: Tue, 17 Sep 2013 16:20:29 -0700 Subject: Conservatively estimate geometry bounds bug:10761696 Avoids a case where a rect with top coordinate of (e.g.) 0.51f is assumed to not draw in the first row of pixels, which leads to it not being clipped. Since rounding can cause it to render in this first pixel anyway, we very slightly expand geometry bounds. Now, in ambiguous cases, the geometry bounds are expanded so clipping is more likely to happen. Change-Id: I119b7c7720de07bac1634549724ffb63935567fc --- libs/hwui/OpenGLRenderer.cpp | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'libs/hwui/OpenGLRenderer.cpp') diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp index 2066f697dca8..89a82fdc4a84 100644 --- a/libs/hwui/OpenGLRenderer.cpp +++ b/libs/hwui/OpenGLRenderer.cpp @@ -1628,14 +1628,7 @@ bool OpenGLRenderer::quickRejectNoScissor(float left, float top, float right, fl Rect r(left, top, right, bottom); currentTransform().mapRect(r); - - if (snapOut) { - // snapOut is generally used to account for 1 pixel ramp (in window coordinates) - // outside of the provided rect boundaries in tessellated AA geometry - r.snapOutToPixelBoundaries(); - } else { - r.snapToPixelBoundaries(); - } + r.snapGeometryToPixelBoundaries(snapOut); Rect clipRect(*mSnapshot->clipRect); clipRect.snapToPixelBoundaries(); -- cgit v1.2.3-59-g8ed1b