OLD | NEW |
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 |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 bool gammaCloseToSRGB() const { | 76 bool gammaCloseToSRGB() const { |
77 return kSRGB_GammaNamed == fGammaNamed || k2Dot2Curve_GammaNamed == fGam
maNamed; | 77 return kSRGB_GammaNamed == fGammaNamed || k2Dot2Curve_GammaNamed == fGam
maNamed; |
78 } | 78 } |
79 | 79 |
80 /** | 80 /** |
81 * Returns nullptr on failure. Fails when we fallback to serializing ICC d
ata and | 81 * Returns nullptr on failure. Fails when we fallback to serializing ICC d
ata and |
82 * the data is too large to serialize. | 82 * the data is too large to serialize. |
83 */ | 83 */ |
84 sk_sp<SkData> serialize() const; | 84 sk_sp<SkData> serialize() const; |
85 | 85 |
| 86 /** |
| 87 * If |memory| is nullptr, returns the size required to serialize. |
| 88 * Otherwise, serializes into |memory| and returns the size. |
| 89 */ |
| 90 size_t writeToMemory(void* memory) const; |
| 91 |
86 static sk_sp<SkColorSpace> Deserialize(const void* data, size_t length); | 92 static sk_sp<SkColorSpace> Deserialize(const void* data, size_t length); |
87 | 93 |
88 protected: | 94 protected: |
89 SkColorSpace(GammaNamed gammaNamed, const SkMatrix44& toXYZD50, Named named)
; | 95 SkColorSpace(GammaNamed gammaNamed, const SkMatrix44& toXYZD50, Named named)
; |
90 | 96 |
91 const GammaNamed fGammaNamed; | 97 const GammaNamed fGammaNamed; |
92 const SkMatrix44 fToXYZD50; | 98 const SkMatrix44 fToXYZD50; |
93 const Named fNamed; | 99 const Named fNamed; |
94 }; | 100 }; |
95 | 101 |
96 #endif | 102 #endif |
OLD | NEW |