Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(538)

Side by Side Diff: include/core/SkSurfaceProps.h

Issue 1845283003: Gamma-correctness pushed into Skia, top-down. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Remove helper function for old pixel-config method of enabling decode Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 SK_API 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 kUseDeviceIndependentFonts_Flag = 1 << 2, 56 kUseDeviceIndependentFonts_Flag = 1 << 2,
robertphillips 2016/04/05 12:54:34 A big old comment here ?
Brian Osman 2016/04/05 15:36:41 Acknowledged.
57 kAllowSRGBInputs_Flag = 1 << 3,
57 }; 58 };
58 /** Deprecated alias used by Chromium. Will be removed. */ 59 /** Deprecated alias used by Chromium. Will be removed. */
59 static const Flags kUseDistanceFieldFonts_Flag = kUseDeviceIndependentFonts_ Flag; 60 static const Flags kUseDistanceFieldFonts_Flag = kUseDeviceIndependentFonts_ Flag;
60 61
61 SkSurfaceProps(uint32_t flags, SkPixelGeometry); 62 SkSurfaceProps(uint32_t flags, SkPixelGeometry);
62 63
63 enum InitType { 64 enum InitType {
64 kLegacyFontHost_InitType 65 kLegacyFontHost_InitType
65 }; 66 };
66 SkSurfaceProps(InitType); 67 SkSurfaceProps(InitType);
67 SkSurfaceProps(uint32_t flags, InitType); 68 SkSurfaceProps(uint32_t flags, InitType);
68 SkSurfaceProps(const SkSurfaceProps& other); 69 SkSurfaceProps(const SkSurfaceProps& other);
69 70
70 uint32_t flags() const { return fFlags; } 71 uint32_t flags() const { return fFlags; }
71 SkPixelGeometry pixelGeometry() const { return fPixelGeometry; } 72 SkPixelGeometry pixelGeometry() const { return fPixelGeometry; }
72 73
73 bool isDisallowAA() const { return SkToBool(fFlags & kDisallowAntiAlias_Flag ); } 74 bool isDisallowAA() const { return SkToBool(fFlags & kDisallowAntiAlias_Flag ); }
74 bool isDisallowDither() const { return SkToBool(fFlags & kDisallowDither_Fla g); } 75 bool isDisallowDither() const { return SkToBool(fFlags & kDisallowDither_Fla g); }
75 bool isUseDeviceIndependentFonts() const { 76 bool isUseDeviceIndependentFonts() const {
76 return SkToBool(fFlags & kUseDeviceIndependentFonts_Flag); 77 return SkToBool(fFlags & kUseDeviceIndependentFonts_Flag);
77 } 78 }
79 bool allowSRGBInputs() const { return SkToBool(fFlags & kAllowSRGBInputs_Fla g); }
78 80
79 private: 81 private:
80 SkSurfaceProps(); 82 SkSurfaceProps();
81 83
82 uint32_t fFlags; 84 uint32_t fFlags;
83 SkPixelGeometry fPixelGeometry; 85 SkPixelGeometry fPixelGeometry;
84 }; 86 };
85 87
86 #endif 88 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698