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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 *color = tempColor; | 45 *color = tempColor; |
46 return true; | 46 return true; |
47 } | 47 } |
48 } | 48 } |
49 return false; | 49 return false; |
50 } | 50 } |
51 | 51 |
52 void GrPaint::resetStages() { | 52 void GrPaint::resetStages() { |
53 fColorStages.reset(); | 53 fColorStages.reset(); |
54 fCoverageStages.reset(); | 54 fCoverageStages.reset(); |
55 fXPFactory.reset(GrPorterDuffXPFactory::Create(kOne_GrBlendCoeff, | 55 fXPFactory.reset(GrPorterDuffXPFactory::Create(SkXfermode::kSrcOver_Mode)); |
56 kZero_GrBlendCoeff)); | |
57 } | 56 } |
58 | 57 |
59 bool GrPaint::getOpaqueAndKnownColor(GrColor* solidColor, | 58 bool GrPaint::getOpaqueAndKnownColor(GrColor* solidColor, |
60 uint32_t* solidColorKnownComponents) const
{ | 59 uint32_t* solidColorKnownComponents) const
{ |
61 | 60 |
62 // TODO: Share this implementation with GrDrawState | 61 // TODO: Share this implementation with GrDrawState |
63 | 62 |
64 GrProcOptInfo coverageProcInfo; | 63 GrProcOptInfo coverageProcInfo; |
65 coverageProcInfo.calcWithInitialValues(fCoverageStages.begin(), this->numCov
erageStages(), | 64 coverageProcInfo.calcWithInitialValues(fCoverageStages.begin(), this->numCov
erageStages(), |
66 0xFFFFFFFF, kRGBA_GrColorComponentFla
gs, true); | 65 0xFFFFFFFF, kRGBA_GrColorComponentFla
gs, true); |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 *solidColorKnownComponents = 0; | 115 *solidColorKnownComponents = 0; |
117 break; | 116 break; |
118 } | 117 } |
119 } else { | 118 } else { |
120 solidColorKnownComponents = 0; | 119 solidColorKnownComponents = 0; |
121 } | 120 } |
122 } | 121 } |
123 return opaque; | 122 return opaque; |
124 } | 123 } |
125 | 124 |
OLD | NEW |