OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 SkImageInfo_DEFINED | 8 #ifndef SkImageInfo_DEFINED |
9 #define SkImageInfo_DEFINED | 9 #define SkImageInfo_DEFINED |
10 | 10 |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 } | 216 } |
217 | 217 |
218 /** | 218 /** |
219 * Sets colortype to the native ARGB32 type, and the alphatype to premul. | 219 * Sets colortype to the native ARGB32 type, and the alphatype to premul. |
220 */ | 220 */ |
221 static SkImageInfo MakeN32Premul(const SkISize& size, | 221 static SkImageInfo MakeN32Premul(const SkISize& size, |
222 SkColorProfileType pt = kLinear_SkColorProf
ileType) { | 222 SkColorProfileType pt = kLinear_SkColorProf
ileType) { |
223 return MakeN32Premul(size.width(), size.height(), pt); | 223 return MakeN32Premul(size.width(), size.height(), pt); |
224 } | 224 } |
225 | 225 |
| 226 /** |
| 227 * Create an ImageInfo marked as SRGB with N32 swizzle. |
| 228 */ |
| 229 static SkImageInfo MakeS32(int width, int height, SkAlphaType at); |
| 230 |
226 static SkImageInfo MakeA8(int width, int height) { | 231 static SkImageInfo MakeA8(int width, int height) { |
227 return SkImageInfo(width, height, kAlpha_8_SkColorType, kPremul_SkAlphaT
ype, | 232 return SkImageInfo(width, height, kAlpha_8_SkColorType, kPremul_SkAlphaT
ype, |
228 kLinear_SkColorProfileType, nullptr); | 233 kLinear_SkColorProfileType, nullptr); |
229 } | 234 } |
230 | 235 |
231 static SkImageInfo MakeUnknown(int width, int height) { | 236 static SkImageInfo MakeUnknown(int width, int height) { |
232 return SkImageInfo(width, height, kUnknown_SkColorType, kUnknown_SkAlpha
Type, | 237 return SkImageInfo(width, height, kUnknown_SkColorType, kUnknown_SkAlpha
Type, |
233 kLinear_SkColorProfileType, nullptr); | 238 kLinear_SkColorProfileType, nullptr); |
234 } | 239 } |
235 | 240 |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
361 | 366 |
362 static inline bool SkColorAndProfileAreGammaCorrect(SkColorType ct, SkColorProfi
leType pt) { | 367 static inline bool SkColorAndProfileAreGammaCorrect(SkColorType ct, SkColorProfi
leType pt) { |
363 return kSRGB_SkColorProfileType == pt || kRGBA_F16_SkColorType == ct; | 368 return kSRGB_SkColorProfileType == pt || kRGBA_F16_SkColorType == ct; |
364 } | 369 } |
365 | 370 |
366 static inline bool SkImageInfoIsGammaCorrect(const SkImageInfo& info) { | 371 static inline bool SkImageInfoIsGammaCorrect(const SkImageInfo& info) { |
367 return SkColorAndProfileAreGammaCorrect(info.colorType(), info.profileType()
); | 372 return SkColorAndProfileAreGammaCorrect(info.colorType(), info.profileType()
); |
368 } | 373 } |
369 | 374 |
370 #endif | 375 #endif |
OLD | NEW |