diff options
author | Chris Craik <ccraik@google.com> | 2013-09-17 16:20:29 -0700 |
---|---|---|
committer | Chris Craik <ccraik@google.com> | 2013-09-17 17:48:14 -0700 |
commit | 32f05e343c5ffb17f3235942bcda651bd3b9f1d6 (patch) | |
tree | f3c0ed7a1a252728c21bd5b178ff69d625bf74d5 /libs/hwui/Program.cpp | |
parent | 0f3e1487b26a822697f70747290809081c2072cc (diff) |
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
Diffstat (limited to 'libs/hwui/Program.cpp')
-rw-r--r-- | libs/hwui/Program.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libs/hwui/Program.cpp b/libs/hwui/Program.cpp index 9e4670e62dcd..7814a01ad929 100644 --- a/libs/hwui/Program.cpp +++ b/libs/hwui/Program.cpp @@ -20,6 +20,7 @@ #include <utils/Trace.h> #include "Program.h" +#include "Vertex.h" namespace android { namespace uirenderer { @@ -172,7 +173,7 @@ void Program::set(const mat4& projectionMatrix, const mat4& modelViewMatrix, // up and to the left. // This offset value is based on an assumption that some hardware may use as // little as 12.4 precision, so we offset by slightly more than 1/16. - p.translate(.065, .065); + p.translate(Vertex::gGeometryFudgeFactor, Vertex::gGeometryFudgeFactor); glUniformMatrix4fv(projection, 1, GL_FALSE, &p.data[0]); } mProjection = projectionMatrix; |