OLD | NEW |
---|---|
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 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 | 9 |
10 #ifndef GrPaint_DEFINED | 10 #ifndef GrPaint_DEFINED |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
63 void setDisableOutputConversionToSRGB(bool srgb) { fDisableOutputConversionT oSRGB = srgb; } | 63 void setDisableOutputConversionToSRGB(bool srgb) { fDisableOutputConversionT oSRGB = srgb; } |
64 bool getDisableOutputConversionToSRGB() const { return fDisableOutputConvers ionToSRGB; } | 64 bool getDisableOutputConversionToSRGB() const { return fDisableOutputConvers ionToSRGB; } |
65 | 65 |
66 /** | 66 /** |
67 * Should sRGB inputs be allowed to perform sRGB to linear conversion. With this flag | 67 * Should sRGB inputs be allowed to perform sRGB to linear conversion. With this flag |
68 * set to false, sRGB textures will be treated as linear (including filterin g). | 68 * set to false, sRGB textures will be treated as linear (including filterin g). |
69 */ | 69 */ |
70 void setAllowSRGBInputs(bool allowSRGBInputs) { fAllowSRGBInputs = allowSRGB Inputs; } | 70 void setAllowSRGBInputs(bool allowSRGBInputs) { fAllowSRGBInputs = allowSRGB Inputs; } |
71 bool getAllowSRGBInputs() const { return fAllowSRGBInputs; } | 71 bool getAllowSRGBInputs() const { return fAllowSRGBInputs; } |
72 | 72 |
73 /** | |
74 * Should rendering be gamma-correct. Causes sRGB inputs to perform conversi on to linear, | |
75 * and outputs to be converted from linear to sRGB (if the destination is sR GB). | |
76 */ | |
77 void setGammaCorrect(bool gammaCorrect) { | |
Brian Osman
2016/04/13 19:54:52
Added this helper method in this change to make ca
bsalomon
2016/04/13 20:03:38
sgtm
| |
78 setDisableOutputConversionToSRGB(!gammaCorrect); | |
79 setAllowSRGBInputs(gammaCorrect); | |
80 } | |
81 | |
73 const GrXPFactory* setXPFactory(const GrXPFactory* xpFactory) { | 82 const GrXPFactory* setXPFactory(const GrXPFactory* xpFactory) { |
74 fXPFactory.reset(SkSafeRef(xpFactory)); | 83 fXPFactory.reset(SkSafeRef(xpFactory)); |
75 return xpFactory; | 84 return xpFactory; |
76 } | 85 } |
77 | 86 |
78 void setPorterDuffXPFactory(SkXfermode::Mode mode) { | 87 void setPorterDuffXPFactory(SkXfermode::Mode mode) { |
79 fXPFactory.reset(GrPorterDuffXPFactory::Create(mode)); | 88 fXPFactory.reset(GrPorterDuffXPFactory::Create(mode)); |
80 } | 89 } |
81 | 90 |
82 void setCoverageSetOpXPFactory(SkRegion::Op regionOp, bool invertCoverage = false); | 91 void setCoverageSetOpXPFactory(SkRegion::Op regionOp, bool invertCoverage = false); |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
170 SkSTArray<2, const GrFragmentProcessor*, true> fCoverageFragmentProcessors; | 179 SkSTArray<2, const GrFragmentProcessor*, true> fCoverageFragmentProcessors; |
171 | 180 |
172 bool fAntiAlias; | 181 bool fAntiAlias; |
173 bool fDisableOutputConversionToSR GB; | 182 bool fDisableOutputConversionToSR GB; |
174 bool fAllowSRGBInputs; | 183 bool fAllowSRGBInputs; |
175 | 184 |
176 GrColor fColor; | 185 GrColor fColor; |
177 }; | 186 }; |
178 | 187 |
179 #endif | 188 #endif |
OLD | NEW |