OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "GrPaint.h" | 8 #include "GrPaint.h" |
9 | 9 |
10 #include "GrProcOptInfo.h" | 10 #include "GrProcOptInfo.h" |
11 #include "effects/GrCoverageSetOpXP.h" | 11 #include "effects/GrCoverageSetOpXP.h" |
12 #include "effects/GrPorterDuffXferProcessor.h" | 12 #include "effects/GrPorterDuffXferProcessor.h" |
13 #include "effects/GrSimpleTextureEffect.h" | 13 #include "effects/GrSimpleTextureEffect.h" |
14 | 14 |
15 GrPaint::GrPaint() | 15 GrPaint::GrPaint() |
16 : fAntiAlias(false) | 16 : fAntiAlias(false) |
17 , fDisableOutputConversionToSRGB(false) | 17 , fDisableOutputConversionToSRGB(false) |
18 , fAllowSRGBInputs(false) | 18 , fAllowSRGBInputs(false) |
| 19 , fUsesDistanceVectorField(false) |
19 , fColor(GrColor4f::FromGrColor(GrColor_WHITE)) {} | 20 , fColor(GrColor4f::FromGrColor(GrColor_WHITE)) {} |
20 | 21 |
21 void GrPaint::setCoverageSetOpXPFactory(SkRegion::Op regionOp, bool invertCovera
ge) { | 22 void GrPaint::setCoverageSetOpXPFactory(SkRegion::Op regionOp, bool invertCovera
ge) { |
22 fXPFactory = GrCoverageSetOpXPFactory::Make(regionOp, invertCoverage); | 23 fXPFactory = GrCoverageSetOpXPFactory::Make(regionOp, invertCoverage); |
23 } | 24 } |
24 | 25 |
25 void GrPaint::addColorTextureProcessor(GrTexture* texture, | 26 void GrPaint::addColorTextureProcessor(GrTexture* texture, |
26 sk_sp<GrColorSpaceXform> colorSpaceXform, | 27 sk_sp<GrColorSpaceXform> colorSpaceXform, |
27 const SkMatrix& matrix) { | 28 const SkMatrix& matrix) { |
28 this->addColorFragmentProcessor(GrSimpleTextureEffect::Make(texture, | 29 this->addColorFragmentProcessor(GrSimpleTextureEffect::Make(texture, |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 colorProcInfo.isOpaq
ue(), | 66 colorProcInfo.isOpaq
ue(), |
66 &blendedColor); | 67 &blendedColor); |
67 } | 68 } |
68 | 69 |
69 if (kRGBA_GrColorComponentFlags == blendedColor.fKnownColorFlags) { | 70 if (kRGBA_GrColorComponentFlags == blendedColor.fKnownColorFlags) { |
70 *color = blendedColor.fKnownColor; | 71 *color = blendedColor.fKnownColor; |
71 return true; | 72 return true; |
72 } | 73 } |
73 return false; | 74 return false; |
74 } | 75 } |
OLD | NEW |