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

Unified Diff: src/core/SkDeviceProperties.h

Issue 652273002: add gamma value to deviceproperties (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 2 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 | « src/core/SkDevice.cpp ('k') | src/core/SkPaint.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkDeviceProperties.h
diff --git a/src/core/SkDeviceProperties.h b/src/core/SkDeviceProperties.h
index 11ecd651570dcb4c9cfc5994b2be83a93a98f4eb..e79f21a2350f1e4b958c73c66e631562cc99be87 100644
--- a/src/core/SkDeviceProperties.h
+++ b/src/core/SkDeviceProperties.h
@@ -14,13 +14,27 @@ struct SkDeviceProperties {
enum InitType {
kLegacyLCD_InitType
};
- SkDeviceProperties(InitType) : fPixelGeometry(SkSurfacePropsDefaultPixelGeometry()) {}
- SkDeviceProperties(SkPixelGeometry geo) : fPixelGeometry(geo) {}
- SkPixelGeometry fPixelGeometry;
+ SkDeviceProperties(InitType, float gamma = SK_GAMMA_EXPONENT)
+ : fGamma(gamma)
+ , fPixelGeometry(SkSurfacePropsDefaultPixelGeometry())
+ {}
+
+ SkDeviceProperties(SkPixelGeometry geo, float gamma = SK_GAMMA_EXPONENT)
+ : fGamma(gamma)
+ , fPixelGeometry(geo)
+ {}
+
+ SkPixelGeometry pixelGeometry() const { return fPixelGeometry; }
+ float gamma() const { return fGamma; }
- // read-only attribute -- until we actually store a value (future CL)
- float getGamma() const { return SK_GAMMA_EXPONENT; }
+ void setPixelGeometry(SkPixelGeometry geo) {
+ fPixelGeometry = geo;
+ }
+
+private:
+ const float fGamma;
+ SkPixelGeometry fPixelGeometry;
};
#endif
« no previous file with comments | « src/core/SkDevice.cpp ('k') | src/core/SkPaint.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698