@@ -1149,7 +1149,6 @@ void OpenGLRenderer::setupDrawColor(int color) {
11491149
11501150void OpenGLRenderer::setupDrawColor (int color, int alpha) {
11511151 mColorA = alpha / 255 .0f ;
1152- mColorA *= mSnapshot ->alpha ;
11531152 // Second divide of a by 255 is an optimization, allowing us to simply multiply
11541153 // the rgb values by a instead of also dividing by 255
11551154 const float a = mColorA / 255 .0f ;
@@ -1181,15 +1180,6 @@ void OpenGLRenderer::setupDrawColor(float r, float g, float b, float a) {
11811180 mSetShaderColor = mDescription .setColor (r, g, b, a);
11821181}
11831182
1184- void OpenGLRenderer::setupDrawAlpha8Color (float r, float g, float b, float a) {
1185- mColorA = a;
1186- mColorR = r;
1187- mColorG = g;
1188- mColorB = b;
1189- mColorSet = true ;
1190- mSetShaderColor = mDescription .setAlpha8Color (r, g, b, a);
1191- }
1192-
11931183void OpenGLRenderer::setupDrawShader () {
11941184 if (mShader ) {
11951185 mShader ->describe (mDescription , mCaches .extensions );
@@ -1771,7 +1761,7 @@ void OpenGLRenderer::drawAARect(float left, float top, float right, float bottom
17711761 setupDraw ();
17721762 setupDrawNoTexture ();
17731763 setupDrawAALine ();
1774- setupDrawColor (color);
1764+ setupDrawColor (color, ((color >> 24 ) & 0xFF ) * mSnapshot -> alpha );
17751765 setupDrawColorFilter ();
17761766 setupDrawShader ();
17771767 setupDrawBlending (true , mode);
@@ -2267,7 +2257,7 @@ status_t OpenGLRenderer::drawRect(float left, float top, float right, float bott
22672257status_t OpenGLRenderer::drawPosText (const char * text, int bytesCount, int count,
22682258 const float * positions, SkPaint* paint) {
22692259 if (text == NULL || count == 0 || mSnapshot ->isIgnored () ||
2270- (paint->getAlpha () == 0 && paint->getXfermode () == NULL )) {
2260+ (paint->getAlpha () * mSnapshot -> alpha == 0 && paint->getXfermode () == NULL )) {
22712261 return DrawGlInfo::kStatusDone ;
22722262 }
22732263
@@ -2340,7 +2330,7 @@ status_t OpenGLRenderer::drawPosText(const char* text, int bytesCount, int count
23402330status_t OpenGLRenderer::drawText (const char * text, int bytesCount, int count,
23412331 float x, float y, SkPaint* paint, float length) {
23422332 if (text == NULL || count == 0 || mSnapshot ->isIgnored () ||
2343- (paint->getAlpha () == 0 && paint->getXfermode () == NULL )) {
2333+ (paint->getAlpha () * mSnapshot -> alpha == 0 && paint->getXfermode () == NULL )) {
23442334 return DrawGlInfo::kStatusDone ;
23452335 }
23462336
@@ -2393,7 +2383,7 @@ status_t OpenGLRenderer::drawText(const char* text, int bytesCount, int count,
23932383 const float sx = oldX - shadow->left + mShadowDx ;
23942384 const float sy = oldY - shadow->top + mShadowDy ;
23952385
2396- const int shadowAlpha = ((mShadowColor >> 24 ) & 0xFF );
2386+ const int shadowAlpha = ((mShadowColor >> 24 ) & 0xFF ) * mSnapshot -> alpha ;
23972387 int shadowColor = mShadowColor ;
23982388 if (mShader ) {
23992389 shadowColor = 0xffffffff ;
@@ -2792,7 +2782,7 @@ void OpenGLRenderer::drawColorRect(float left, float top, float right, float bot
27922782
27932783 setupDraw ();
27942784 setupDrawNoTexture ();
2795- setupDrawColor (color);
2785+ setupDrawColor (color, ((color >> 24 ) & 0xFF ) * mSnapshot -> alpha );
27962786 setupDrawShader ();
27972787 setupDrawColorFilter ();
27982788 setupDrawBlending (mode);
0 commit comments