Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(109)

Side by Side Diff: include/gpu/GrPaint.h

Issue 1845283003: Gamma-correctness pushed into Skia, top-down. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Remove helper function for old pixel-config method of enabling decode Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 void setAntiAlias(bool aa) { fAntiAlias = aa; } 56 void setAntiAlias(bool aa) { fAntiAlias = aa; }
57 bool isAntiAlias() const { return fAntiAlias; } 57 bool isAntiAlias() const { return fAntiAlias; }
58 58
59 /** 59 /**
60 * Should shader output conversion from linear to sRGB be disabled. 60 * Should shader output conversion from linear to sRGB be disabled.
61 * Only relevant if the destination is sRGB. Defaults to false. 61 * Only relevant if the destination is sRGB. Defaults to false.
62 */ 62 */
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 /**
robertphillips 2016/04/05 12:54:34 Expand on this a bit?
Brian Osman 2016/04/05 15:36:41 Acknowledged.
67 * Should sRGB inputs be allowed to perform sRGB to linear conversion.
68 */
69 void setAllowSRGBInputs(bool allowSRGBInputs) { fAllowSRGBInputs = allowSRGB Inputs; }
70 bool getAllowSRGBInputs() const { return fAllowSRGBInputs; }
71
66 const GrXPFactory* setXPFactory(const GrXPFactory* xpFactory) { 72 const GrXPFactory* setXPFactory(const GrXPFactory* xpFactory) {
67 fXPFactory.reset(SkSafeRef(xpFactory)); 73 fXPFactory.reset(SkSafeRef(xpFactory));
68 return xpFactory; 74 return xpFactory;
69 } 75 }
70 76
71 void setPorterDuffXPFactory(SkXfermode::Mode mode) { 77 void setPorterDuffXPFactory(SkXfermode::Mode mode) {
72 fXPFactory.reset(GrPorterDuffXPFactory::Create(mode)); 78 fXPFactory.reset(GrPorterDuffXPFactory::Create(mode));
73 } 79 }
74 80
75 void setCoverageSetOpXPFactory(SkRegion::Op regionOp, bool invertCoverage = false); 81 void setCoverageSetOpXPFactory(SkRegion::Op regionOp, bool invertCoverage = false);
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 const GrFragmentProcessor* getColorFragmentProcessor(int i) const { 119 const GrFragmentProcessor* getColorFragmentProcessor(int i) const {
114 return fColorFragmentProcessors[i]; 120 return fColorFragmentProcessors[i];
115 } 121 }
116 const GrFragmentProcessor* getCoverageFragmentProcessor(int i) const { 122 const GrFragmentProcessor* getCoverageFragmentProcessor(int i) const {
117 return fCoverageFragmentProcessors[i]; 123 return fCoverageFragmentProcessors[i];
118 } 124 }
119 125
120 GrPaint& operator=(const GrPaint& paint) { 126 GrPaint& operator=(const GrPaint& paint) {
121 fAntiAlias = paint.fAntiAlias; 127 fAntiAlias = paint.fAntiAlias;
122 fDisableOutputConversionToSRGB = paint.fDisableOutputConversionToSRGB; 128 fDisableOutputConversionToSRGB = paint.fDisableOutputConversionToSRGB;
129 fAllowSRGBInputs = paint.fAllowSRGBInputs;
123 130
124 fColor = paint.fColor; 131 fColor = paint.fColor;
125 this->resetFragmentProcessors(); 132 this->resetFragmentProcessors();
126 fColorFragmentProcessors = paint.fColorFragmentProcessors; 133 fColorFragmentProcessors = paint.fColorFragmentProcessors;
127 fCoverageFragmentProcessors = paint.fCoverageFragmentProcessors; 134 fCoverageFragmentProcessors = paint.fCoverageFragmentProcessors;
128 for (int i = 0; i < fColorFragmentProcessors.count(); ++i) { 135 for (int i = 0; i < fColorFragmentProcessors.count(); ++i) {
129 fColorFragmentProcessors[i]->ref(); 136 fColorFragmentProcessors[i]->ref();
130 } 137 }
131 for (int i = 0; i < fCoverageFragmentProcessors.count(); ++i) { 138 for (int i = 0; i < fCoverageFragmentProcessors.count(); ++i) {
132 fCoverageFragmentProcessors[i]->ref(); 139 fCoverageFragmentProcessors[i]->ref();
(...skipping 23 matching lines...) Expand all
156 fColorFragmentProcessors.reset(); 163 fColorFragmentProcessors.reset();
157 fCoverageFragmentProcessors.reset(); 164 fCoverageFragmentProcessors.reset();
158 } 165 }
159 166
160 mutable SkAutoTUnref<const GrXPFactory> fXPFactory; 167 mutable SkAutoTUnref<const GrXPFactory> fXPFactory;
161 SkSTArray<4, const GrFragmentProcessor*, true> fColorFragmentProcessors; 168 SkSTArray<4, const GrFragmentProcessor*, true> fColorFragmentProcessors;
162 SkSTArray<2, const GrFragmentProcessor*, true> fCoverageFragmentProcessors; 169 SkSTArray<2, const GrFragmentProcessor*, true> fCoverageFragmentProcessors;
163 170
164 bool fAntiAlias; 171 bool fAntiAlias;
165 bool fDisableOutputConversionToSR GB; 172 bool fDisableOutputConversionToSR GB;
173 bool fAllowSRGBInputs;
166 174
167 GrColor fColor; 175 GrColor fColor;
168 }; 176 };
169 177
170 #endif 178 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698