| 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 30 matching lines...) Expand all Loading... |
| 41 // Returns true iff geo is a known geometry and is vertical. | 41 // Returns true iff geo is a known geometry and is vertical. |
| 42 static inline bool SkPixelGeometryIsV(SkPixelGeometry geo) { | 42 static inline bool SkPixelGeometryIsV(SkPixelGeometry geo) { |
| 43 return kRGB_V_SkPixelGeometry == geo || kBGR_V_SkPixelGeometry == geo; | 43 return kRGB_V_SkPixelGeometry == geo || kBGR_V_SkPixelGeometry == geo; |
| 44 } | 44 } |
| 45 | 45 |
| 46 /** | 46 /** |
| 47 * Describes properties and constraints of a given SkSurface. The rendering eng
ine can parse these | 47 * Describes properties and constraints of a given SkSurface. The rendering eng
ine can parse these |
| 48 * during drawing, and can sometimes optimize its performance (e.g. disabling a
n expensive | 48 * during drawing, and can sometimes optimize its performance (e.g. disabling a
n expensive |
| 49 * feature). | 49 * feature). |
| 50 */ | 50 */ |
| 51 class SkSurfaceProps { | 51 class SK_API SkSurfaceProps { |
| 52 public: | 52 public: |
| 53 enum Flags { | 53 enum Flags { |
| 54 kDisallowAntiAlias_Flag = 1 << 0, | 54 kDisallowAntiAlias_Flag = 1 << 0, |
| 55 kDisallowDither_Flag = 1 << 1, | 55 kDisallowDither_Flag = 1 << 1, |
| 56 kUseDistanceFieldFonts_Flag = 1 << 2, | 56 kUseDistanceFieldFonts_Flag = 1 << 2, |
| 57 }; | 57 }; |
| 58 SkSurfaceProps(uint32_t flags, SkPixelGeometry); | 58 SkSurfaceProps(uint32_t flags, SkPixelGeometry); |
| 59 | 59 |
| 60 enum InitType { | 60 enum InitType { |
| 61 kLegacyFontHost_InitType | 61 kLegacyFontHost_InitType |
| 62 }; | 62 }; |
| 63 SkSurfaceProps(InitType); | 63 SkSurfaceProps(InitType); |
| 64 SkSurfaceProps(uint32_t flags, InitType); | 64 SkSurfaceProps(uint32_t flags, InitType); |
| 65 | 65 |
| 66 uint32_t flags() const { return fFlags; } | 66 uint32_t flags() const { return fFlags; } |
| 67 SkPixelGeometry pixelGeometry() const { return fPixelGeometry; } | 67 SkPixelGeometry pixelGeometry() const { return fPixelGeometry; } |
| 68 | 68 |
| 69 bool isDisallowAA() const { return SkToBool(fFlags & kDisallowAntiAlias_Flag
); } | 69 bool isDisallowAA() const { return SkToBool(fFlags & kDisallowAntiAlias_Flag
); } |
| 70 bool isDisallowDither() const { return SkToBool(fFlags & kDisallowDither_Fla
g); } | 70 bool isDisallowDither() const { return SkToBool(fFlags & kDisallowDither_Fla
g); } |
| 71 bool isUseDistanceFieldFonts() const { return SkToBool(fFlags & kUseDistance
FieldFonts_Flag); } | 71 bool isUseDistanceFieldFonts() const { return SkToBool(fFlags & kUseDistance
FieldFonts_Flag); } |
| 72 | 72 |
| 73 private: | 73 private: |
| 74 SkSurfaceProps(); | 74 SkSurfaceProps(); |
| 75 | 75 |
| 76 uint32_t fFlags; | 76 uint32_t fFlags; |
| 77 SkPixelGeometry fPixelGeometry; | 77 SkPixelGeometry fPixelGeometry; |
| 78 }; | 78 }; |
| 79 | 79 |
| 80 #endif | 80 #endif |
| OLD | NEW |