diff options
author | Romain Guy <romainguy@google.com> | 2011-05-26 16:51:47 -0700 |
---|---|---|
committer | Romain Guy <romainguy@google.com> | 2011-05-26 16:53:26 -0700 |
commit | e324197ecd14591d7db0572f50c0d21bbd269bb4 (patch) | |
tree | d6aecfb32305759211c116bc654b173b524b2582 /libs | |
parent | 27ac64eceee8d4e392983861c6bc6bd620e4c6f7 (diff) | |
download | frameworks_base-e324197ecd14591d7db0572f50c0d21bbd269bb4.zip frameworks_base-e324197ecd14591d7db0572f50c0d21bbd269bb4.tar.gz frameworks_base-e324197ecd14591d7db0572f50c0d21bbd269bb4.tar.bz2 |
DO NOT MERGE Correctly implement the CLEAR xfermode.
This bug is a regression from the software pipeline and prevents
applications from implementing an "eraser" type tool (for instance
a drawing/painting apps.) This issue affects external applications
when they turn on hardware acceleration.
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: I1446e83480e46174b880120069d76fcad14ba300
Diffstat (limited to 'libs')
-rw-r--r-- | libs/hwui/OpenGLRenderer.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp index d9d7d23..ffcae1c 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 }, |