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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/gpu/GrCaps.h ('k') | src/gpu/GrPaint.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/gpu/GrPaint.h
diff --git a/include/gpu/GrPaint.h b/include/gpu/GrPaint.h
index 152cb51d7e7144373e360abf0c611c92db453c91..3f06f092ab45fe55b132252f2d647356c0feefe8 100644
--- a/include/gpu/GrPaint.h
+++ b/include/gpu/GrPaint.h
@@ -56,6 +56,13 @@ public:
void setAntiAlias(bool aa) { fAntiAlias = aa; }
bool isAntiAlias() const { return fAntiAlias; }
+ /**
+ * Should shader output conversion from linear to sRGB be disabled.
+ * Only relevant if the destination is sRGB. Defaults to false.
+ */
+ void setDisableOutputConversionToSRGB(bool srgb) { fDisableOutputConversionToSRGB = srgb; }
+ bool getDisableOutputConversionToSRGB() const { return fDisableOutputConversionToSRGB; }
+
const GrXPFactory* setXPFactory(const GrXPFactory* xpFactory) {
fXPFactory.reset(SkSafeRef(xpFactory));
return xpFactory;
@@ -112,6 +119,7 @@ public:
GrPaint& operator=(const GrPaint& paint) {
fAntiAlias = paint.fAntiAlias;
+ fDisableOutputConversionToSRGB = paint.fDisableOutputConversionToSRGB;
fColor = paint.fColor;
this->resetFragmentProcessors();
@@ -154,6 +162,7 @@ private:
SkSTArray<2, const GrFragmentProcessor*, true> fCoverageFragmentProcessors;
bool fAntiAlias;
+ bool fDisableOutputConversionToSRGB;
GrColor fColor;
};
« 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