Browse files

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 <>
Signed-off-by: Yuyang Du <>
Signed-off-by: Jack Ren <>
Signed-off-by: Bruce Beare <>
  • Loading branch information...
1 parent 9ad1c52 commit 2acb0f966fe28b1d0f3fccd65c8532abc1283752 @ydu19 ydu19 committed with Whitehawkx Aug 1, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 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]);

0 comments on commit 2acb0f9

Please sign in to comment.