From 909cbaf8f92d69f507bbdba9e5aa960d1e6c7a1f Mon Sep 17 00:00:00 2001 From: Romain Guy Date: Wed, 13 Oct 2010 18:19:48 -0700 Subject: Don't draw TextView's alpha layers when not needed. Change-Id: Iedf42cbc62d727f18500c78fcccf2d081a761fec --- libs/hwui/OpenGLRenderer.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'libs/hwui/OpenGLRenderer.cpp') diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp index d81760d96c83..ac3bc9c3ee46 100644 --- a/libs/hwui/OpenGLRenderer.cpp +++ b/libs/hwui/OpenGLRenderer.cpp @@ -455,6 +455,7 @@ bool OpenGLRenderer::createLayer(sp snapshot, float left, float top, #endif // Clear the FBO + bounds.snapToPixelBoundaries(); glScissor(0.0f, 0.0f, bounds.getWidth(), bounds.getHeight()); glClearColor(0.0f, 0.0f, 0.0f, 0.0f); glClear(GL_COLOR_BUFFER_BIT); -- cgit v1.2.3-59-g8ed1b From 93d2361c6d294c390cb5c4a13bd1b88dcd465fd7 Mon Sep 17 00:00:00 2001 From: Romain Guy Date: Wed, 13 Oct 2010 18:26:36 -0700 Subject: Fix layer rendering glitch. Change-Id: If2f987fe5526fc88743ca3e91edde4f8232ff658 --- libs/hwui/OpenGLRenderer.cpp | 3 +-- libs/hwui/Rect.h | 8 ++++---- 2 files changed, 5 insertions(+), 6 deletions(-) (limited to 'libs/hwui/OpenGLRenderer.cpp') diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp index ac3bc9c3ee46..287601092f20 100644 --- a/libs/hwui/OpenGLRenderer.cpp +++ b/libs/hwui/OpenGLRenderer.cpp @@ -455,8 +455,7 @@ bool OpenGLRenderer::createLayer(sp snapshot, float left, float top, #endif // Clear the FBO - bounds.snapToPixelBoundaries(); - glScissor(0.0f, 0.0f, bounds.getWidth(), bounds.getHeight()); + glScissor(0.0f, 0.0f, bounds.getWidth() + 1.0f, bounds.getHeight() + 1.0f); glClearColor(0.0f, 0.0f, 0.0f, 0.0f); glClear(GL_COLOR_BUFFER_BIT); diff --git a/libs/hwui/Rect.h b/libs/hwui/Rect.h index f03a602ba06e..c571ea17b109 100644 --- a/libs/hwui/Rect.h +++ b/libs/hwui/Rect.h @@ -149,10 +149,10 @@ struct Rect { } void snapToPixelBoundaries() { - left = floor(left); - top = floor(top); - right = ceil(right); - bottom = ceil(bottom); + left = floorf(left); + top = floorf(top); + right = ceilf(right); + bottom = ceilf(bottom); } void dump() const { -- cgit v1.2.3-59-g8ed1b