OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 SkDeviceProfile_DEFINED | 8 #ifndef SkDeviceProfile_DEFINED |
9 #define SkDeviceProfile_DEFINED | 9 #define SkDeviceProfile_DEFINED |
10 | 10 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 * "default". Otherwise the paint's hinting level will be | 45 * "default". Otherwise the paint's hinting level will be |
46 * respected. | 46 * respected. |
47 */ | 47 */ |
48 static SkDeviceProfile* Create(float gammaExp, | 48 static SkDeviceProfile* Create(float gammaExp, |
49 float contrastScale, | 49 float contrastScale, |
50 LCDConfig, | 50 LCDConfig, |
51 FontHintLevel); | 51 FontHintLevel); |
52 | 52 |
53 /** | 53 /** |
54 * Returns the global default profile, that is used if no global profile is | 54 * Returns the global default profile, that is used if no global profile is |
55 * specified with SetGlobal(), or if NULL is specified to SetGlobal(). | 55 * specified with SetGlobal(), or if nullptr is specified to SetGlobal(). |
56 * The references count is *not* incremented, and the caller should not | 56 * The references count is *not* incremented, and the caller should not |
57 * call unref(). | 57 * call unref(). |
58 */ | 58 */ |
59 static SkDeviceProfile* GetDefault(); | 59 static SkDeviceProfile* GetDefault(); |
60 | 60 |
61 /** | 61 /** |
62 * Return the current global profile (or the default if no global had yet | 62 * Return the current global profile (or the default if no global had yet |
63 * been set) and increment its reference count. The call *must* call unref(
) | 63 * been set) and increment its reference count. The call *must* call unref(
) |
64 * when it is done using it. | 64 * when it is done using it. |
65 */ | 65 */ |
66 static SkDeviceProfile* RefGlobal(); | 66 static SkDeviceProfile* RefGlobal(); |
67 | 67 |
68 /** | 68 /** |
69 * Make the specified profile be the global value for all subsequently | 69 * Make the specified profile be the global value for all subsequently |
70 * instantiated devices. Does not affect any existing devices. | 70 * instantiated devices. Does not affect any existing devices. |
71 * Increments the reference count on the profile. | 71 * Increments the reference count on the profile. |
72 * Specify NULL for the "identity" profile (where there is no gamma or | 72 * Specify nullptr for the "identity" profile (where there is no gamma or |
73 * contrast correction). | 73 * contrast correction). |
74 */ | 74 */ |
75 static void SetGlobal(SkDeviceProfile*); | 75 static void SetGlobal(SkDeviceProfile*); |
76 | 76 |
77 float getFontGammaExponent() const { return fGammaExponent; } | 77 float getFontGammaExponent() const { return fGammaExponent; } |
78 float getFontContrastScale() const { return fContrastScale; } | 78 float getFontContrastScale() const { return fContrastScale; } |
79 | 79 |
80 /** | 80 /** |
81 * Given a luminance byte (0 for black, 0xFF for white), generate a table | 81 * Given a luminance byte (0 for black, 0xFF for white), generate a table |
82 * that applies the gamma/contrast settings to linear coverage values. | 82 * that applies the gamma/contrast settings to linear coverage values. |
83 */ | 83 */ |
84 void generateTableForLuminanceByte(U8CPU lumByte, uint8_t table[256]) const; | 84 void generateTableForLuminanceByte(U8CPU lumByte, uint8_t table[256]) const; |
85 | 85 |
86 private: | 86 private: |
87 SkDeviceProfile(float gammaExp, float contrastScale, LCDConfig, | 87 SkDeviceProfile(float gammaExp, float contrastScale, LCDConfig, |
88 FontHintLevel); | 88 FontHintLevel); |
89 | 89 |
90 float fGammaExponent; | 90 float fGammaExponent; |
91 float fContrastScale; | 91 float fContrastScale; |
92 LCDConfig fLCDConfig; | 92 LCDConfig fLCDConfig; |
93 FontHintLevel fFontHintLevel; | 93 FontHintLevel fFontHintLevel; |
94 | 94 |
95 typedef SkRefCnt INHERITED; | 95 typedef SkRefCnt INHERITED; |
96 }; | 96 }; |
97 | 97 |
98 #endif | 98 #endif |
OLD | NEW |