diff options
author | Yuyang Du <yuyang.du@intel.com> | 2012-08-01 18:07:28 -0400 |
---|---|---|
committer | Yuyang Du <yuyang.du@intel.com> | 2012-08-01 19:54:35 -0400 |
commit | 68ca7b3168f78f2354bf15934857c1705f22025e (patch) | |
tree | 73501623beb5530b201f3bf78f5a685ba0919ca5 | |
parent | ceeb43093b8e721dfe6671d7da44c1d1fd6f6ed8 (diff) | |
download | external_webkit-68ca7b3168f78f2354bf15934857c1705f22025e.zip external_webkit-68ca7b3168f78f2354bf15934857c1705f22025e.tar.gz external_webkit-68ca7b3168f78f2354bf15934857c1705f22025e.tar.bz2 |
Fix browser rendering issue: pure color tiles are rendered black
The “pure color tile” optimization finds the pure-color tiles and
then draws the tiles simply with the color (otherwise the texture).
But the RGBA color pointer type is char, which may overflow when
the value is larger than 127. In such case, the tiles in question
are rendered black, because of the wrong color. This bug is fixed
by defining the pointer as unsigned char.
Change-Id: I5c7214423fa6961e707bde72f0e18c610374745d
Author: Yuyang Du <yuyang.du@intel.com>
Signed-off-by: Yuyang Du <yuyang.du@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
-rw-r--r-- | Source/WebCore/platform/graphics/android/rendering/GLUtils.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Source/WebCore/platform/graphics/android/rendering/GLUtils.cpp b/Source/WebCore/platform/graphics/android/rendering/GLUtils.cpp index bfa0789..4a0b77b 100644 --- a/Source/WebCore/platform/graphics/android/rendering/GLUtils.cpp +++ b/Source/WebCore/platform/graphics/android/rendering/GLUtils.cpp @@ -409,7 +409,7 @@ bool GLUtils::isPureColorBitmap(const SkBitmap& bitmap, Color& pureColor) pixelsRow = 0; if (sameColor) { - char* rgbaPtr = static_cast<char*>(bitmap.getPixels()); + unsigned char* rgbaPtr = static_cast<unsigned char*>(bitmap.getPixels()); pureColor = Color(rgbaPtr[0], rgbaPtr[1], rgbaPtr[2], rgbaPtr[3]); ALOGV("sameColor tile found , %x at (%d, %d, %d, %d)", *firstPixelPtr, rgbaPtr[0], rgbaPtr[1], rgbaPtr[2], rgbaPtr[3]); |