aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorGravatar brianosman <brianosman@google.com>2016-04-13 13:10:14 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-04-13 13:10:14 -0700
commitb461d3457567cf79a3efac3123c00f7afc37fecb (patch)
tree6b1600d0da18cefc3e29568419354bd68c9e5b41 /include
parent54ef1a7c95bcc8e507f7d6ccd9a49bd9a110ba90 (diff)
Rename lots of things from 'sRGB' to 'GammaCorrect', where appropriate
Trying to be much more explicit about where we really mean sRGB as a format, and where we mean gamma-correct, as in: "not legacy behavior". Most of the changes to rendering behavior are dependent on the latter, so let's be precise. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1884873006 Review URL: https://codereview.chromium.org/1884873006
Diffstat (limited to 'include')
-rw-r--r--include/core/SkSurfaceProps.h4
-rw-r--r--include/gpu/GrDrawContext.h2
-rw-r--r--include/gpu/GrPaint.h9
3 files changed, 12 insertions, 3 deletions
diff --git a/include/core/SkSurfaceProps.h b/include/core/SkSurfaceProps.h
index bd4fa8e7fc..c9b2564e2f 100644
--- a/include/core/SkSurfaceProps.h
+++ b/include/core/SkSurfaceProps.h
@@ -64,7 +64,7 @@ public:
* It is recommended to enable this flag when rendering to an sRGB or floating point
* surface.
*/
- kAllowSRGBInputs_Flag = 1 << 3,
+ kGammaCorrect_Flag = 1 << 3,
};
/** Deprecated alias used by Chromium. Will be removed. */
static const Flags kUseDistanceFieldFonts_Flag = kUseDeviceIndependentFonts_Flag;
@@ -86,7 +86,7 @@ public:
bool isUseDeviceIndependentFonts() const {
return SkToBool(fFlags & kUseDeviceIndependentFonts_Flag);
}
- bool allowSRGBInputs() const { return SkToBool(fFlags & kAllowSRGBInputs_Flag); }
+ bool isGammaCorrect() const { return SkToBool(fFlags & kGammaCorrect_Flag); }
private:
SkSurfaceProps();
diff --git a/include/gpu/GrDrawContext.h b/include/gpu/GrDrawContext.h
index 06954dc1bb..61b39079b0 100644
--- a/include/gpu/GrDrawContext.h
+++ b/include/gpu/GrDrawContext.h
@@ -276,7 +276,7 @@ public:
int width() const { return fRenderTarget->width(); }
int height() const { return fRenderTarget->height(); }
int numColorSamples() const { return fRenderTarget->numColorSamples(); }
- bool allowSRGBInputs() const { return fSurfaceProps.allowSRGBInputs(); }
+ bool isGammaCorrect() const { return fSurfaceProps.isGammaCorrect(); }
GrRenderTarget* accessRenderTarget() { return fRenderTarget; }
diff --git a/include/gpu/GrPaint.h b/include/gpu/GrPaint.h
index 87e0368655..f9633e7978 100644
--- a/include/gpu/GrPaint.h
+++ b/include/gpu/GrPaint.h
@@ -70,6 +70,15 @@ public:
void setAllowSRGBInputs(bool allowSRGBInputs) { fAllowSRGBInputs = allowSRGBInputs; }
bool getAllowSRGBInputs() const { return fAllowSRGBInputs; }
+ /**
+ * Should rendering be gamma-correct. Causes sRGB inputs to perform conversion to linear,
+ * and outputs to be converted from linear to sRGB (if the destination is sRGB).
+ */
+ void setGammaCorrect(bool gammaCorrect) {
+ setDisableOutputConversionToSRGB(!gammaCorrect);
+ setAllowSRGBInputs(gammaCorrect);
+ }
+
const GrXPFactory* setXPFactory(const GrXPFactory* xpFactory) {
fXPFactory.reset(SkSafeRef(xpFactory));
return xpFactory;