summaryrefslogtreecommitdiff
path: root/libs/hwui/OpenGLRenderer.cpp
diff options
context:
space:
mode:
author Romain Guy <romainguy@google.com> 2011-05-26 16:40:55 -0700
committer Romain Guy <romainguy@google.com> 2011-05-26 16:40:55 -0700
commitf504a2fa144504ca1efd39a4ef9208e3d4d336c5 (patch)
tree3d797f8910ac7615bddfc073435d8a26fcb80e61 /libs/hwui/OpenGLRenderer.cpp
parent3453b1c584f456a18f17d74a72c044b4e39c6405 (diff)
Correctly implement the CLEAR xfermode.
The previous implementation was using glBlendFunc with the parameters GL_ZERO/GL_ZERO which doesn't work for text, paths and other alpha sources (anti-aliasing.) The correct implementation is GL_ZERO/ GL_ONE_MINUS_SRC_ALPHA. Change-Id: I4cca65e57b6a37bbf5a41d382cb0648ee8e11e79
Diffstat (limited to 'libs/hwui/OpenGLRenderer.cpp')
-rw-r--r--libs/hwui/OpenGLRenderer.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp
index 560c1f9c9072..8cf325b81a38 100644
--- a/libs/hwui/OpenGLRenderer.cpp
+++ b/libs/hwui/OpenGLRenderer.cpp
@@ -63,7 +63,7 @@ struct Blender {
// In this array, the index of each Blender equals the value of the first
// entry. For instance, gBlends[1] == gBlends[SkXfermode::kSrc_Mode]
static const Blender gBlends[] = {
- { SkXfermode::kClear_Mode, GL_ZERO, GL_ZERO },
+ { SkXfermode::kClear_Mode, GL_ZERO, GL_ONE_MINUS_SRC_ALPHA },
{ SkXfermode::kSrc_Mode, GL_ONE, GL_ZERO },
{ SkXfermode::kDst_Mode, GL_ZERO, GL_ONE },
{ SkXfermode::kSrcOver_Mode, GL_ONE, GL_ONE_MINUS_SRC_ALPHA },
@@ -81,7 +81,7 @@ static const Blender gBlends[] = {
// this array's SrcOver blending mode is actually DstOver. You can refer to
// createLayer() for more information on the purpose of this array.
static const Blender gBlendsSwap[] = {
- { SkXfermode::kClear_Mode, GL_ZERO, GL_ZERO },
+ { SkXfermode::kClear_Mode, GL_ONE_MINUS_DST_ALPHA, GL_ZERO },
{ SkXfermode::kSrc_Mode, GL_ZERO, GL_ONE },
{ SkXfermode::kDst_Mode, GL_ONE, GL_ZERO },
{ SkXfermode::kSrcOver_Mode, GL_ONE_MINUS_DST_ALPHA, GL_ONE },