| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2006 The Android Open Source Project | 3 * Copyright 2006 The Android Open Source Project |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 | 9 |
| 10 #ifndef SkMask_DEFINED | 10 #ifndef SkMask_DEFINED |
| 11 #define SkMask_DEFINED | 11 #define SkMask_DEFINED |
| 12 | 12 |
| 13 #include "SkRect.h" | 13 #include "SkRect.h" |
| 14 | 14 |
| 15 /** \class SkMask | 15 /** \class SkMask |
| 16 SkMask is used to describe alpha bitmaps, either 1bit, 8bit, or | 16 SkMask is used to describe alpha bitmaps, either 1bit, 8bit, or |
| 17 the 3-channel 3D format. These are passed to SkMaskFilter objects. | 17 the 3-channel 3D format. These are passed to SkMaskFilter objects. |
| 18 */ | 18 */ |
| 19 struct SkMask { | 19 struct SkMask { |
| 20 SkMask() : fImage(nullptr) {} |
| 21 |
| 20 enum Format { | 22 enum Format { |
| 21 kBW_Format, //!< 1bit per pixel mask (e.g. monochrome) | 23 kBW_Format, //!< 1bit per pixel mask (e.g. monochrome) |
| 22 kA8_Format, //!< 8bits per pixel mask (e.g. antialiasing) | 24 kA8_Format, //!< 8bits per pixel mask (e.g. antialiasing) |
| 23 k3D_Format, //!< 3 8bit per pixl planes: alpha, mul, add | 25 k3D_Format, //!< 3 8bit per pixl planes: alpha, mul, add |
| 24 kARGB32_Format, //!< SkPMColor | 26 kARGB32_Format, //!< SkPMColor |
| 25 kLCD16_Format, //!< 565 alpha for r/g/b | 27 kLCD16_Format, //!< 565 alpha for r/g/b |
| 26 }; | 28 }; |
| 27 | 29 |
| 28 enum { | 30 enum { |
| 29 kCountMaskFormats = kLCD16_Format + 1 | 31 kCountMaskFormats = kLCD16_Format + 1 |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 ~SkAutoMaskFreeImage() { | 141 ~SkAutoMaskFreeImage() { |
| 140 SkMask::FreeImage(fImage); | 142 SkMask::FreeImage(fImage); |
| 141 } | 143 } |
| 142 | 144 |
| 143 private: | 145 private: |
| 144 uint8_t* fImage; | 146 uint8_t* fImage; |
| 145 }; | 147 }; |
| 146 #define SkAutoMaskFreeImage(...) SK_REQUIRE_LOCAL_VAR(SkAutoMaskFreeImage) | 148 #define SkAutoMaskFreeImage(...) SK_REQUIRE_LOCAL_VAR(SkAutoMaskFreeImage) |
| 147 | 149 |
| 148 #endif | 150 #endif |
| OLD | NEW |