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 , fColor(GrColor_WHITE) {} | 19 , fColor(GrColor_WHITE) {} |
19 | 20 |
20 void GrPaint::setCoverageSetOpXPFactory(SkRegion::Op regionOp, bool invertCovera
ge) { | 21 void GrPaint::setCoverageSetOpXPFactory(SkRegion::Op regionOp, bool invertCovera
ge) { |
21 fXPFactory.reset(GrCoverageSetOpXPFactory::Create(regionOp, invertCoverage))
; | 22 fXPFactory.reset(GrCoverageSetOpXPFactory::Create(regionOp, invertCoverage))
; |
22 } | 23 } |
23 | 24 |
24 void GrPaint::addColorTextureProcessor(GrTexture* texture, const SkMatrix& matri
x) { | 25 void GrPaint::addColorTextureProcessor(GrTexture* texture, const SkMatrix& matri
x) { |
25 this->addColorFragmentProcessor(GrSimpleTextureEffect::Create(texture, matri
x))->unref(); | 26 this->addColorFragmentProcessor(GrSimpleTextureEffect::Create(texture, matri
x))->unref(); |
26 } | 27 } |
27 | 28 |
(...skipping 30 matching lines...) Expand all Loading... |
58 colorProcInfo.isOpaq
ue(), | 59 colorProcInfo.isOpaq
ue(), |
59 &blendedColor); | 60 &blendedColor); |
60 } | 61 } |
61 | 62 |
62 if (kRGBA_GrColorComponentFlags == blendedColor.fKnownColorFlags) { | 63 if (kRGBA_GrColorComponentFlags == blendedColor.fKnownColorFlags) { |
63 *color = blendedColor.fKnownColor; | 64 *color = blendedColor.fKnownColor; |
64 return true; | 65 return true; |
65 } | 66 } |
66 return false; | 67 return false; |
67 } | 68 } |
OLD | NEW |