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

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

Issue 1830303002: Require sRGB write control for sRGB support. Add flag to GrPaint to suppress linear -> sRGB convers… (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Added comment to srgbSupport() Created 4 years, 9 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
« no previous file with comments | « include/gpu/GrCaps.h ('k') | src/gpu/GrPaint.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 */ 49 */
50 void setColor(GrColor color) { fColor = color; } 50 void setColor(GrColor color) { fColor = color; }
51 GrColor getColor() const { return fColor; } 51 GrColor getColor() const { return fColor; }
52 52
53 /** 53 /**
54 * Should primitives be anti-aliased or not. Defaults to false. 54 * Should primitives be anti-aliased or not. Defaults to false.
55 */ 55 */
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 /**
60 * Should shader output conversion from linear to sRGB be disabled.
61 * Only relevant if the destination is sRGB. Defaults to false.
62 */
63 void setDisableOutputConversionToSRGB(bool srgb) { fDisableOutputConversionT oSRGB = srgb; }
64 bool getDisableOutputConversionToSRGB() const { return fDisableOutputConvers ionToSRGB; }
65
59 const GrXPFactory* setXPFactory(const GrXPFactory* xpFactory) { 66 const GrXPFactory* setXPFactory(const GrXPFactory* xpFactory) {
60 fXPFactory.reset(SkSafeRef(xpFactory)); 67 fXPFactory.reset(SkSafeRef(xpFactory));
61 return xpFactory; 68 return xpFactory;
62 } 69 }
63 70
64 void setPorterDuffXPFactory(SkXfermode::Mode mode) { 71 void setPorterDuffXPFactory(SkXfermode::Mode mode) {
65 fXPFactory.reset(GrPorterDuffXPFactory::Create(mode)); 72 fXPFactory.reset(GrPorterDuffXPFactory::Create(mode));
66 } 73 }
67 74
68 void setCoverageSetOpXPFactory(SkRegion::Op regionOp, bool invertCoverage = false); 75 void setCoverageSetOpXPFactory(SkRegion::Op regionOp, bool invertCoverage = false);
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 112
106 const GrFragmentProcessor* getColorFragmentProcessor(int i) const { 113 const GrFragmentProcessor* getColorFragmentProcessor(int i) const {
107 return fColorFragmentProcessors[i]; 114 return fColorFragmentProcessors[i];
108 } 115 }
109 const GrFragmentProcessor* getCoverageFragmentProcessor(int i) const { 116 const GrFragmentProcessor* getCoverageFragmentProcessor(int i) const {
110 return fCoverageFragmentProcessors[i]; 117 return fCoverageFragmentProcessors[i];
111 } 118 }
112 119
113 GrPaint& operator=(const GrPaint& paint) { 120 GrPaint& operator=(const GrPaint& paint) {
114 fAntiAlias = paint.fAntiAlias; 121 fAntiAlias = paint.fAntiAlias;
122 fDisableOutputConversionToSRGB = paint.fDisableOutputConversionToSRGB;
115 123
116 fColor = paint.fColor; 124 fColor = paint.fColor;
117 this->resetFragmentProcessors(); 125 this->resetFragmentProcessors();
118 fColorFragmentProcessors = paint.fColorFragmentProcessors; 126 fColorFragmentProcessors = paint.fColorFragmentProcessors;
119 fCoverageFragmentProcessors = paint.fCoverageFragmentProcessors; 127 fCoverageFragmentProcessors = paint.fCoverageFragmentProcessors;
120 for (int i = 0; i < fColorFragmentProcessors.count(); ++i) { 128 for (int i = 0; i < fColorFragmentProcessors.count(); ++i) {
121 fColorFragmentProcessors[i]->ref(); 129 fColorFragmentProcessors[i]->ref();
122 } 130 }
123 for (int i = 0; i < fCoverageFragmentProcessors.count(); ++i) { 131 for (int i = 0; i < fCoverageFragmentProcessors.count(); ++i) {
124 fCoverageFragmentProcessors[i]->ref(); 132 fCoverageFragmentProcessors[i]->ref();
(...skipping 22 matching lines...) Expand all
147 } 155 }
148 fColorFragmentProcessors.reset(); 156 fColorFragmentProcessors.reset();
149 fCoverageFragmentProcessors.reset(); 157 fCoverageFragmentProcessors.reset();
150 } 158 }
151 159
152 mutable SkAutoTUnref<const GrXPFactory> fXPFactory; 160 mutable SkAutoTUnref<const GrXPFactory> fXPFactory;
153 SkSTArray<4, const GrFragmentProcessor*, true> fColorFragmentProcessors; 161 SkSTArray<4, const GrFragmentProcessor*, true> fColorFragmentProcessors;
154 SkSTArray<2, const GrFragmentProcessor*, true> fCoverageFragmentProcessors; 162 SkSTArray<2, const GrFragmentProcessor*, true> fCoverageFragmentProcessors;
155 163
156 bool fAntiAlias; 164 bool fAntiAlias;
165 bool fDisableOutputConversionToSR GB;
157 166
158 GrColor fColor; 167 GrColor fColor;
159 }; 168 };
160 169
161 #endif 170 #endif
OLDNEW
« no previous file with comments | « include/gpu/GrCaps.h ('k') | src/gpu/GrPaint.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698