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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « src/core/SkDevice.cpp ('k') | src/core/SkPaint.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 * Copyright 2014 Google Inc. 2 * Copyright 2014 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #ifndef SkDeviceProperties_DEFINED 8 #ifndef SkDeviceProperties_DEFINED
9 #define SkDeviceProperties_DEFINED 9 #define SkDeviceProperties_DEFINED
10 10
11 #include "SkSurfacePriv.h" 11 #include "SkSurfacePriv.h"
12 12
13 struct SkDeviceProperties { 13 struct SkDeviceProperties {
14 enum InitType { 14 enum InitType {
15 kLegacyLCD_InitType 15 kLegacyLCD_InitType
16 }; 16 };
17 SkDeviceProperties(InitType) : fPixelGeometry(SkSurfacePropsDefaultPixelGeom etry()) {}
18 SkDeviceProperties(SkPixelGeometry geo) : fPixelGeometry(geo) {}
19 17
18 SkDeviceProperties(InitType, float gamma = SK_GAMMA_EXPONENT)
19 : fGamma(gamma)
20 , fPixelGeometry(SkSurfacePropsDefaultPixelGeometry())
21 {}
22
23 SkDeviceProperties(SkPixelGeometry geo, float gamma = SK_GAMMA_EXPONENT)
24 : fGamma(gamma)
25 , fPixelGeometry(geo)
26 {}
27
28 SkPixelGeometry pixelGeometry() const { return fPixelGeometry; }
29 float gamma() const { return fGamma; }
30
31 void setPixelGeometry(SkPixelGeometry geo) {
32 fPixelGeometry = geo;
33 }
34
35 private:
36 const float fGamma;
20 SkPixelGeometry fPixelGeometry; 37 SkPixelGeometry fPixelGeometry;
21
22 // read-only attribute -- until we actually store a value (future CL)
23 float getGamma() const { return SK_GAMMA_EXPONENT; }
24 }; 38 };
25 39
26 #endif 40 #endif
OLDNEW
« 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