summaryrefslogtreecommitdiff
path: root/libs/hwui/OpenGLRenderer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libs/hwui/OpenGLRenderer.cpp')
-rw-r--r--libs/hwui/OpenGLRenderer.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp
index 670d049956f9..d6c00534d655 100644
--- a/libs/hwui/OpenGLRenderer.cpp
+++ b/libs/hwui/OpenGLRenderer.cpp
@@ -353,6 +353,8 @@ bool OpenGLRenderer::createLayer(sp<Snapshot> snapshot, float left, float top,
// Layers only make sense if they are in the framebuffer's bounds
bounds.intersect(*mSnapshot->clipRect);
+ bounds.snapToPixelBoundaries();
+
if (bounds.isEmpty() || bounds.getWidth() > mMaxTextureSize ||
bounds.getHeight() > mMaxTextureSize) {
return false;