OLD | NEW |
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 SkDeviceProperties(const SkDeviceProperties& src) | 14 enum InitType { |
15 : fGamma(src.fGamma) | 15 kLegacyLCD_InitType |
16 , fPixelGeometry(src.fPixelGeometry) { | 16 }; |
17 } | |
18 | 17 |
19 SkDeviceProperties(float gamma = SK_GAMMA_EXPONENT) | 18 SkDeviceProperties(InitType, float gamma = SK_GAMMA_EXPONENT) |
20 : fGamma(gamma) | 19 : fGamma(gamma) |
21 , fPixelGeometry(SkSurfacePropsDefaultPixelGeometry()) | 20 , fPixelGeometry(SkSurfacePropsDefaultPixelGeometry()) |
22 {} | 21 {} |
23 | 22 |
24 SkDeviceProperties(SkPixelGeometry geo, float gamma = SK_GAMMA_EXPONENT) | 23 SkDeviceProperties(SkPixelGeometry geo, float gamma = SK_GAMMA_EXPONENT) |
25 : fGamma(gamma) | 24 : fGamma(gamma) |
26 , fPixelGeometry(geo) | 25 , fPixelGeometry(geo) |
27 {} | 26 {} |
28 | 27 |
| 28 SkPixelGeometry pixelGeometry() const { return fPixelGeometry; } |
29 float gamma() const { return fGamma; } | 29 float gamma() const { return fGamma; } |
30 SkPixelGeometry pixelGeometry() const { return fPixelGeometry; } | |
31 | 30 |
32 void setPixelGeometry(SkPixelGeometry geo) { | 31 void setPixelGeometry(SkPixelGeometry geo) { |
33 fPixelGeometry = geo; | 32 fPixelGeometry = geo; |
34 } | 33 } |
35 | 34 |
36 private: | 35 private: |
37 const float fGamma; | 36 const float fGamma; |
38 SkPixelGeometry fPixelGeometry; | 37 SkPixelGeometry fPixelGeometry; |
39 }; | 38 }; |
40 | 39 |
41 #endif | 40 #endif |
OLD | NEW |