@@ -1148,7 +1148,6 @@ void OpenGLRenderer::setupDrawColor(int color) {
11481148
11491149void OpenGLRenderer::setupDrawColor (int color, int alpha) {
11501150 mColorA = alpha / 255 .0f ;
1151- mColorA *= mSnapshot ->alpha ;
11521151 // Second divide of a by 255 is an optimization, allowing us to simply multiply
11531152 // the rgb values by a instead of also dividing by 255
11541153 const float a = mColorA / 255 .0f ;
@@ -1180,15 +1179,6 @@ void OpenGLRenderer::setupDrawColor(float r, float g, float b, float a) {
11801179 mSetShaderColor = mDescription .setColor (r, g, b, a);
11811180}
11821181
1183- void OpenGLRenderer::setupDrawAlpha8Color (float r, float g, float b, float a) {
1184- mColorA = a;
1185- mColorR = r;
1186- mColorG = g;
1187- mColorB = b;
1188- mColorSet = true ;
1189- mSetShaderColor = mDescription .setAlpha8Color (r, g, b, a);
1190- }
1191-
11921182void OpenGLRenderer::setupDrawShader () {
11931183 if (mShader ) {
11941184 mShader ->describe (mDescription , mCaches .extensions );
@@ -1770,7 +1760,7 @@ void OpenGLRenderer::drawAARect(float left, float top, float right, float bottom
17701760 setupDraw ();
17711761 setupDrawNoTexture ();
17721762 setupDrawAALine ();
1773- setupDrawColor (color);
1763+ setupDrawColor (color, ((color >> 24 ) & 0xFF ) * mSnapshot -> alpha );
17741764 setupDrawColorFilter ();
17751765 setupDrawShader ();
17761766 setupDrawBlending (true , mode);
@@ -2266,7 +2256,7 @@ status_t OpenGLRenderer::drawRect(float left, float top, float right, float bott
22662256status_t OpenGLRenderer::drawPosText (const char * text, int bytesCount, int count,
22672257 const float * positions, SkPaint* paint) {
22682258 if (text == NULL || count == 0 || mSnapshot ->isIgnored () ||
2269- (paint->getAlpha () == 0 && paint->getXfermode () == NULL )) {
2259+ (paint->getAlpha () * mSnapshot -> alpha == 0 && paint->getXfermode () == NULL )) {
22702260 return DrawGlInfo::kStatusDone ;
22712261 }
22722262
@@ -2339,7 +2329,7 @@ status_t OpenGLRenderer::drawPosText(const char* text, int bytesCount, int count
23392329status_t OpenGLRenderer::drawText (const char * text, int bytesCount, int count,
23402330 float x, float y, SkPaint* paint, float length) {
23412331 if (text == NULL || count == 0 || mSnapshot ->isIgnored () ||
2342- (paint->getAlpha () == 0 && paint->getXfermode () == NULL )) {
2332+ (paint->getAlpha () * mSnapshot -> alpha == 0 && paint->getXfermode () == NULL )) {
23432333 return DrawGlInfo::kStatusDone ;
23442334 }
23452335
@@ -2392,7 +2382,7 @@ status_t OpenGLRenderer::drawText(const char* text, int bytesCount, int count,
23922382 const float sx = oldX - shadow->left + mShadowDx ;
23932383 const float sy = oldY - shadow->top + mShadowDy ;
23942384
2395- const int shadowAlpha = ((mShadowColor >> 24 ) & 0xFF );
2385+ const int shadowAlpha = ((mShadowColor >> 24 ) & 0xFF ) * mSnapshot -> alpha ;
23962386 int shadowColor = mShadowColor ;
23972387 if (mShader ) {
23982388 shadowColor = 0xffffffff ;
@@ -2791,7 +2781,7 @@ void OpenGLRenderer::drawColorRect(float left, float top, float right, float bot
27912781
27922782 setupDraw ();
27932783 setupDrawNoTexture ();
2794- setupDrawColor (color);
2784+ setupDrawColor (color, ((color >> 24 ) & 0xFF ) * mSnapshot -> alpha );
27952785 setupDrawShader ();
27962786 setupDrawColorFilter ();
27972787 setupDrawBlending (mode);
0 commit comments