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