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

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

Issue 2302413002: Delete SkColorSpace::kUnknown_Named, remove fNamed field (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 3 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
« no previous file with comments | « no previous file | src/core/SkColorSpace.cpp » ('j') | src/core/SkColorSpace.cpp » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2016 Google Inc. 2 * Copyright 2016 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 SkColorSpace_DEFINED 8 #ifndef SkColorSpace_DEFINED
9 #define SkColorSpace_DEFINED 9 #define SkColorSpace_DEFINED
10 10
11 #include "SkMatrix44.h" 11 #include "SkMatrix44.h"
12 #include "SkRefCnt.h" 12 #include "SkRefCnt.h"
13 13
14 class SkData; 14 class SkData;
15 15
16 class SK_API SkColorSpace : public SkRefCnt { 16 class SK_API SkColorSpace : public SkRefCnt {
17 public: 17 public:
18 18
19 /** 19 /**
20 * Common, named profiles that we can recognize. 20 * Common, named profiles that we can recognize.
21 */ 21 */
22 enum Named { 22 enum Named : uint8_t {
23 kUnknown_Named, 23 /**
24 * By far the most common color space.
25 * This is the default space for images, unmarked content, and monitors .
26 */
24 kSRGB_Named, 27 kSRGB_Named,
28
29 /**
30 * Very common wide gamut color space.
31 * Often used by images and monitors.
32 */
25 kAdobeRGB_Named, 33 kAdobeRGB_Named,
26 }; 34 };
27 35
28 enum GammaNamed { 36 enum GammaNamed : uint8_t {
29 kLinear_GammaNamed, 37 kLinear_GammaNamed,
30 38
31 /** 39 /**
32 * Gamma curve is a close match to the canonical sRGB curve, which has 40 * Gamma curve is a close match to the canonical sRGB curve, which has
33 * a short linear segment followed by a 2.4f exponential. 41 * a short linear segment followed by a 2.4f exponential.
34 */ 42 */
35 kSRGB_GammaNamed, 43 kSRGB_GammaNamed,
36 44
37 /** 45 /**
38 * Gamma curve is a close match to the 2.2f exponential curve. This is 46 * Gamma curve is a close match to the 2.2f exponential curve. This is
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 117
110 static sk_sp<SkColorSpace> Deserialize(const void* data, size_t length); 118 static sk_sp<SkColorSpace> Deserialize(const void* data, size_t length);
111 119
112 /** 120 /**
113 * If both are null, we return true. If one is null and the other is not, we return false. 121 * If both are null, we return true. If one is null and the other is not, we return false.
114 * If both are non-null, we do a deeper compare. 122 * If both are non-null, we do a deeper compare.
115 */ 123 */
116 static bool Equals(const SkColorSpace* src, const SkColorSpace* dst); 124 static bool Equals(const SkColorSpace* src, const SkColorSpace* dst);
117 125
118 protected: 126 protected:
119 SkColorSpace(GammaNamed gammaNamed, const SkMatrix44& toXYZD50, Named named) ; 127 SkColorSpace(GammaNamed gammaNamed, const SkMatrix44& toXYZD50);
120 128
121 const GammaNamed fGammaNamed; 129 const GammaNamed fGammaNamed;
122 const SkMatrix44 fToXYZD50; 130 const SkMatrix44 fToXYZD50;
123 const Named fNamed;
124 }; 131 };
125 132
126 #endif 133 #endif
OLDNEW
« no previous file with comments | « no previous file | src/core/SkColorSpace.cpp » ('j') | src/core/SkColorSpace.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698