| 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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 return false; | 72 return false; |
| 73 } | 73 } |
| 74 | 74 |
| 75 GrColor color = fColor; | 75 GrColor color = fColor; |
| 76 uint32_t colorComps = kRGBA_GrColorComponentFlags; | 76 uint32_t colorComps = kRGBA_GrColorComponentFlags; |
| 77 count = fColorStages.count(); | 77 count = fColorStages.count(); |
| 78 for (int i = 0; i < count; ++i) { | 78 for (int i = 0; i < count; ++i) { |
| 79 (*fColorStages[i].getEffect())->getConstantColorComponents(&color, &colo
rComps); | 79 (*fColorStages[i].getEffect())->getConstantColorComponents(&color, &colo
rComps); |
| 80 } | 80 } |
| 81 | 81 |
| 82 GrAssert((NULL == solidColor) == (NULL == solidColorKnownComponents)); | 82 SkASSERT((NULL == solidColor) == (NULL == solidColorKnownComponents)); |
| 83 | 83 |
| 84 GrBlendCoeff srcCoeff = fSrcBlendCoeff; | 84 GrBlendCoeff srcCoeff = fSrcBlendCoeff; |
| 85 GrBlendCoeff dstCoeff = fDstBlendCoeff; | 85 GrBlendCoeff dstCoeff = fDstBlendCoeff; |
| 86 GrSimplifyBlend(&srcCoeff, &dstCoeff, color, colorComps, 0, 0, 0); | 86 GrSimplifyBlend(&srcCoeff, &dstCoeff, color, colorComps, 0, 0, 0); |
| 87 | 87 |
| 88 bool opaque = kZero_GrBlendCoeff == dstCoeff && !GrBlendCoeffRefsDst(srcCoef
f); | 88 bool opaque = kZero_GrBlendCoeff == dstCoeff && !GrBlendCoeffRefsDst(srcCoef
f); |
| 89 if (NULL != solidColor) { | 89 if (NULL != solidColor) { |
| 90 if (opaque) { | 90 if (opaque) { |
| 91 switch (srcCoeff) { | 91 switch (srcCoeff) { |
| 92 case kZero_GrBlendCoeff: | 92 case kZero_GrBlendCoeff: |
| (...skipping 27 matching lines...) Expand all Loading... |
| 120 case kIConstA_GrBlendCoeff: | 120 case kIConstA_GrBlendCoeff: |
| 121 *solidColorKnownComponents = 0; | 121 *solidColorKnownComponents = 0; |
| 122 break; | 122 break; |
| 123 } | 123 } |
| 124 } else { | 124 } else { |
| 125 solidColorKnownComponents = 0; | 125 solidColorKnownComponents = 0; |
| 126 } | 126 } |
| 127 } | 127 } |
| 128 return opaque; | 128 return opaque; |
| 129 } | 129 } |
| OLD | NEW |