diff options
author | Romain Guy <romainguy@google.com> | 2010-12-14 13:45:54 -0800 |
---|---|---|
committer | Romain Guy <romainguy@google.com> | 2010-12-14 13:45:54 -0800 |
commit | fa7952dbb86a8aff0c90418aa77dddee3802c23a (patch) | |
tree | dce2d4499eb2d54b46640eaa9a30264dce6e9a2d /libs | |
parent | 5536841e5452172e7772d84ad5f4a2fc7059c9dd (diff) | |
download | frameworks_base-fa7952dbb86a8aff0c90418aa77dddee3802c23a.zip frameworks_base-fa7952dbb86a8aff0c90418aa77dddee3802c23a.tar.gz frameworks_base-fa7952dbb86a8aff0c90418aa77dddee3802c23a.tar.bz2 |
Colors are in the [0..1] range, not [0..255]
This fixes rendering in YouTube and other applications.
Change-Id: Ib5f3df632cde97374113ed42f895f136b2796373
Diffstat (limited to 'libs')
-rw-r--r-- | libs/hwui/OpenGLRenderer.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp index 46fdc31..72c8950 100644 --- a/libs/hwui/OpenGLRenderer.cpp +++ b/libs/hwui/OpenGLRenderer.cpp @@ -849,9 +849,9 @@ void OpenGLRenderer::setupDrawWithTexture(bool isAlpha8) { void OpenGLRenderer::setupDrawColor(int color) { mColorA = ((color >> 24) & 0xFF) / 255.0f; const float a = mColorA / 255.0f; - mColorR = mColorA * ((color >> 16) & 0xFF); - mColorG = mColorA * ((color >> 8) & 0xFF); - mColorB = mColorA * ((color ) & 0xFF); + mColorR = a * ((color >> 16) & 0xFF); + mColorG = a * ((color >> 8) & 0xFF); + mColorB = a * ((color ) & 0xFF); mColorSet = true; mSetShaderColor = mDescription.setColor(mColorR, mColorG, mColorB, mColorA); } |