| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2013 Google Inc. | 3 * Copyright 2013 Google Inc. |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 #include "GrPaint.h" | 9 #include "GrPaint.h" |
| 10 | 10 |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 fColorStages[i].getEffect()->getConstantColorComponents(&color, &colorCo
mps); | 69 fColorStages[i].getEffect()->getConstantColorComponents(&color, &colorCo
mps); |
| 70 } | 70 } |
| 71 | 71 |
| 72 SkASSERT((NULL == solidColor) == (NULL == solidColorKnownComponents)); | 72 SkASSERT((NULL == solidColor) == (NULL == solidColorKnownComponents)); |
| 73 | 73 |
| 74 GrBlendCoeff srcCoeff = fSrcBlendCoeff; | 74 GrBlendCoeff srcCoeff = fSrcBlendCoeff; |
| 75 GrBlendCoeff dstCoeff = fDstBlendCoeff; | 75 GrBlendCoeff dstCoeff = fDstBlendCoeff; |
| 76 GrSimplifyBlend(&srcCoeff, &dstCoeff, color, colorComps, 0, 0, 0); | 76 GrSimplifyBlend(&srcCoeff, &dstCoeff, color, colorComps, 0, 0, 0); |
| 77 | 77 |
| 78 bool opaque = kZero_GrBlendCoeff == dstCoeff && !GrBlendCoeffRefsDst(srcCoef
f); | 78 bool opaque = kZero_GrBlendCoeff == dstCoeff && !GrBlendCoeffRefsDst(srcCoef
f); |
| 79 if (NULL != solidColor) { | 79 if (solidColor) { |
| 80 if (opaque) { | 80 if (opaque) { |
| 81 switch (srcCoeff) { | 81 switch (srcCoeff) { |
| 82 case kZero_GrBlendCoeff: | 82 case kZero_GrBlendCoeff: |
| 83 *solidColor = 0; | 83 *solidColor = 0; |
| 84 *solidColorKnownComponents = kRGBA_GrColorComponentFlags; | 84 *solidColorKnownComponents = kRGBA_GrColorComponentFlags; |
| 85 break; | 85 break; |
| 86 | 86 |
| 87 case kOne_GrBlendCoeff: | 87 case kOne_GrBlendCoeff: |
| 88 *solidColor = color; | 88 *solidColor = color; |
| 89 *solidColorKnownComponents = colorComps; | 89 *solidColorKnownComponents = colorComps; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 110 case kIConstA_GrBlendCoeff: | 110 case kIConstA_GrBlendCoeff: |
| 111 *solidColorKnownComponents = 0; | 111 *solidColorKnownComponents = 0; |
| 112 break; | 112 break; |
| 113 } | 113 } |
| 114 } else { | 114 } else { |
| 115 solidColorKnownComponents = 0; | 115 solidColorKnownComponents = 0; |
| 116 } | 116 } |
| 117 } | 117 } |
| 118 return opaque; | 118 return opaque; |
| 119 } | 119 } |
| OLD | NEW |