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 23 matching lines...) Expand all Loading... |
34 | 34 |
35 bool GrPaint::isOpaqueAndConstantColor(GrColor* color) const { | 35 bool GrPaint::isOpaqueAndConstantColor(GrColor* color) const { |
36 GrProcOptInfo coverageProcInfo; | 36 GrProcOptInfo coverageProcInfo; |
37 coverageProcInfo.calcWithInitialValues(fCoverageStages.begin(), this->numCov
erageStages(), | 37 coverageProcInfo.calcWithInitialValues(fCoverageStages.begin(), this->numCov
erageStages(), |
38 0xFFFFFFFF, kRGBA_GrColorComponentFla
gs, true); | 38 0xFFFFFFFF, kRGBA_GrColorComponentFla
gs, true); |
39 GrProcOptInfo colorProcInfo; | 39 GrProcOptInfo colorProcInfo; |
40 colorProcInfo.calcWithInitialValues(fColorStages.begin(), this->numColorStag
es(), fColor, | 40 colorProcInfo.calcWithInitialValues(fColorStages.begin(), this->numColorStag
es(), fColor, |
41 kRGBA_GrColorComponentFlags, false); | 41 kRGBA_GrColorComponentFlags, false); |
42 | 42 |
43 GrXPFactory::InvariantOutput output; | 43 GrXPFactory::InvariantOutput output; |
44 fXPFactory->getInvariantOutput(colorProcInfo, coverageProcInfo, true, &outpu
t); | 44 fXPFactory->getInvariantOutput(colorProcInfo, coverageProcInfo, &output); |
45 | 45 |
46 if (kRGBA_GrColorComponentFlags == output.fBlendedColorFlags && | 46 if (kRGBA_GrColorComponentFlags == output.fBlendedColorFlags && |
47 0xFF == GrColorUnpackA(output.fBlendedColor)) { | 47 0xFF == GrColorUnpackA(output.fBlendedColor)) { |
48 *color = output.fBlendedColor; | 48 *color = output.fBlendedColor; |
49 return true; | 49 return true; |
50 } | 50 } |
51 return false; | 51 return false; |
52 } | 52 } |
53 | 53 |
54 void GrPaint::resetStages() { | 54 void GrPaint::resetStages() { |
55 fColorStages.reset(); | 55 fColorStages.reset(); |
56 fCoverageStages.reset(); | 56 fCoverageStages.reset(); |
57 fXPFactory.reset(GrPorterDuffXPFactory::Create(SkXfermode::kSrc_Mode)); | 57 fXPFactory.reset(GrPorterDuffXPFactory::Create(SkXfermode::kSrc_Mode)); |
58 } | 58 } |
59 | 59 |
OLD | NEW |