| 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 } | 48 } |
| 49 | 49 |
| 50 bool GrPaint::getOpaqueAndKnownColor(GrColor* solidColor, | 50 bool GrPaint::getOpaqueAndKnownColor(GrColor* solidColor, |
| 51 uint32_t* solidColorKnownComponents) const
{ | 51 uint32_t* solidColorKnownComponents) const
{ |
| 52 | 52 |
| 53 // TODO: Share this implementation with GrDrawState | 53 // TODO: Share this implementation with GrDrawState |
| 54 | 54 |
| 55 GrProcessor::InvariantOutput inout; | 55 GrProcessor::InvariantOutput inout; |
| 56 inout.fColor = GrColorPackRGBA(fCoverage, fCoverage, fCoverage, fCoverage); | 56 inout.fColor = GrColorPackRGBA(fCoverage, fCoverage, fCoverage, fCoverage); |
| 57 inout.fValidFlags = kRGBA_GrColorComponentFlags; | 57 inout.fValidFlags = kRGBA_GrColorComponentFlags; |
| 58 inout.fIsSingleComponent = false; | 58 inout.fIsSingleComponent = true; |
| 59 int count = fCoverageStages.count(); | 59 int count = fCoverageStages.count(); |
| 60 for (int i = 0; i < count; ++i) { | 60 for (int i = 0; i < count; ++i) { |
| 61 fCoverageStages[i].getProcessor()->computeInvariantOutput(&inout); | 61 fCoverageStages[i].getProcessor()->computeInvariantOutput(&inout); |
| 62 } | 62 } |
| 63 if (!inout.isSolidWhite()) { | 63 if (!inout.isSolidWhite()) { |
| 64 return false; | 64 return false; |
| 65 } | 65 } |
| 66 | 66 |
| 67 inout.fColor = fColor; | 67 inout.fColor = fColor; |
| 68 inout.fValidFlags = kRGBA_GrColorComponentFlags; | 68 inout.fValidFlags = kRGBA_GrColorComponentFlags; |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 case kIConstA_GrBlendCoeff: | 114 case kIConstA_GrBlendCoeff: |
| 115 *solidColorKnownComponents = 0; | 115 *solidColorKnownComponents = 0; |
| 116 break; | 116 break; |
| 117 } | 117 } |
| 118 } else { | 118 } else { |
| 119 solidColorKnownComponents = 0; | 119 solidColorKnownComponents = 0; |
| 120 } | 120 } |
| 121 } | 121 } |
| 122 return opaque; | 122 return opaque; |
| 123 } | 123 } |
| OLD | NEW |