From fa7952dbb86a8aff0c90418aa77dddee3802c23a Mon Sep 17 00:00:00 2001 From: Romain Guy Date: Tue, 14 Dec 2010 13:45:54 -0800 Subject: Colors are in the [0..1] range, not [0..255] This fixes rendering in YouTube and other applications. Change-Id: Ib5f3df632cde97374113ed42f895f136b2796373 --- libs/hwui/OpenGLRenderer.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'libs/hwui/OpenGLRenderer.cpp') diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp index 46fdc316bf82..72c895054cac 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); } -- cgit v1.2.3-59-g8ed1b