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 SkSurfaceProps_DEFINED | 8 #ifndef SkSurfaceProps_DEFINED |
9 #define SkSurfaceProps_DEFINED | 9 #define SkSurfaceProps_DEFINED |
10 | 10 |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 | 57 |
58 /** | 58 /** |
59 * This flag causes sRGB inputs to the color pipeline (images and other
sRGB-tagged | 59 * This flag causes sRGB inputs to the color pipeline (images and other
sRGB-tagged |
60 * colors) to be gamma-corrected (converted to linear) before use. With
out this flag, | 60 * colors) to be gamma-corrected (converted to linear) before use. With
out this flag, |
61 * texture scaling and filtering is not gamma correct, preserving the b
ehavior of Skia | 61 * texture scaling and filtering is not gamma correct, preserving the b
ehavior of Skia |
62 * up through 2015. | 62 * up through 2015. |
63 * | 63 * |
64 * It is recommended to enable this flag when rendering to an sRGB or f
loating point | 64 * It is recommended to enable this flag when rendering to an sRGB or f
loating point |
65 * surface. | 65 * surface. |
66 */ | 66 */ |
67 kAllowSRGBInputs_Flag = 1 << 3, | 67 kGammaCorrect_Flag = 1 << 3, |
68 }; | 68 }; |
69 /** Deprecated alias used by Chromium. Will be removed. */ | 69 /** Deprecated alias used by Chromium. Will be removed. */ |
70 static const Flags kUseDistanceFieldFonts_Flag = kUseDeviceIndependentFonts_
Flag; | 70 static const Flags kUseDistanceFieldFonts_Flag = kUseDeviceIndependentFonts_
Flag; |
71 | 71 |
72 SkSurfaceProps(uint32_t flags, SkPixelGeometry); | 72 SkSurfaceProps(uint32_t flags, SkPixelGeometry); |
73 | 73 |
74 enum InitType { | 74 enum InitType { |
75 kLegacyFontHost_InitType | 75 kLegacyFontHost_InitType |
76 }; | 76 }; |
77 SkSurfaceProps(InitType); | 77 SkSurfaceProps(InitType); |
78 SkSurfaceProps(uint32_t flags, InitType); | 78 SkSurfaceProps(uint32_t flags, InitType); |
79 SkSurfaceProps(const SkSurfaceProps& other); | 79 SkSurfaceProps(const SkSurfaceProps& other); |
80 | 80 |
81 uint32_t flags() const { return fFlags; } | 81 uint32_t flags() const { return fFlags; } |
82 SkPixelGeometry pixelGeometry() const { return fPixelGeometry; } | 82 SkPixelGeometry pixelGeometry() const { return fPixelGeometry; } |
83 | 83 |
84 bool isDisallowAA() const { return SkToBool(fFlags & kDisallowAntiAlias_Flag
); } | 84 bool isDisallowAA() const { return SkToBool(fFlags & kDisallowAntiAlias_Flag
); } |
85 bool isDisallowDither() const { return SkToBool(fFlags & kDisallowDither_Fla
g); } | 85 bool isDisallowDither() const { return SkToBool(fFlags & kDisallowDither_Fla
g); } |
86 bool isUseDeviceIndependentFonts() const { | 86 bool isUseDeviceIndependentFonts() const { |
87 return SkToBool(fFlags & kUseDeviceIndependentFonts_Flag); | 87 return SkToBool(fFlags & kUseDeviceIndependentFonts_Flag); |
88 } | 88 } |
89 bool allowSRGBInputs() const { return SkToBool(fFlags & kAllowSRGBInputs_Fla
g); } | 89 bool isGammaCorrect() const { return SkToBool(fFlags & kGammaCorrect_Flag);
} |
90 | 90 |
91 private: | 91 private: |
92 SkSurfaceProps(); | 92 SkSurfaceProps(); |
93 | 93 |
94 uint32_t fFlags; | 94 uint32_t fFlags; |
95 SkPixelGeometry fPixelGeometry; | 95 SkPixelGeometry fPixelGeometry; |
96 }; | 96 }; |
97 | 97 |
98 #endif | 98 #endif |
OLD | NEW |