OLD | NEW |
(Empty) | |
| 1 /* |
| 2 * Copyright 2014 Google Inc. |
| 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. |
| 6 */ |
| 7 |
| 8 #ifndef SkSurfaceProps_DEFINED |
| 9 #define SkSurfaceProps_DEFINED |
| 10 |
| 11 #include "SkPoint.h" |
| 12 |
| 13 /** |
| 14 * Description of how the LCD strips are arranged for each pixel. If this is un
known, or the |
| 15 * pixels are meant to be "portable" and/or transformed before showing (e.g. ro
tated, scaled) |
| 16 * then use kUnknown_SkPixelGeometry. |
| 17 */ |
| 18 enum SkPixelGeometry { |
| 19 kUnknown_SkPixelGeometry, |
| 20 kRGB_H_SkPixelGeometry, |
| 21 kBGR_H_SkPixelGeometry, |
| 22 kRGB_V_SkPixelGeometry, |
| 23 kBGR_V_SkPixelGeometry, |
| 24 |
| 25 // don't specify this explicitly |
| 26 kLegacyLCD_SkPixelGeometry, |
| 27 }; |
| 28 |
| 29 /** |
| 30 * Describes properties and constraints of a given SkSurface. The rendering eng
ine can parse these |
| 31 * during drawing, and can sometimes optimized its performance (e.g. disabling
an expensive |
| 32 * feature). |
| 33 */ |
| 34 class SkSurfaceProps { |
| 35 public: |
| 36 enum Flags { |
| 37 kDisallowAntiAlias_Flag = 1 << 0, |
| 38 kDisallowDither_Flag = 1 << 1, |
| 39 kUseDistanceFieldFonts_Flag = 1 << 2, |
| 40 }; |
| 41 |
| 42 // uses kLegacyLCD_SkPixelGeometry |
| 43 SkSurfaceProps(); |
| 44 |
| 45 // pixel geometry cannot be kLegacyLCD_SkPixelGeometry |
| 46 SkSurfaceProps(uint32_t flags, SkPixelGeometry); |
| 47 |
| 48 uint32_t flags() const { return fFlags; } |
| 49 SkPixelGeometry pixelGeometry() const { return fPixelGeometry; } |
| 50 |
| 51 private: |
| 52 uint32_t fFlags; |
| 53 SkPixelGeometry fPixelGeometry; |
| 54 }; |
| 55 |
| 56 #endif |
OLD | NEW |