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

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

Issue 2086583002: update callers to not use SkColorProfileType (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update callers to not use SkColorProfileType Created 4 years, 6 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 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
11 #include "SkColorSpace.h" 11 #include "SkColorSpace.h"
12 #include "SkMath.h" 12 #include "SkMath.h"
13 #include "SkRect.h" 13 #include "SkRect.h"
14 #include "SkSize.h" 14 #include "SkSize.h"
15 15
16 #define SK_SUPPORT_LEGACY_COLORPROFILETYPE 16 //#define SK_SUPPORT_LEGACY_COLORPROFILETYPE
17 17
18 class SkReadBuffer; 18 class SkReadBuffer;
19 class SkWriteBuffer; 19 class SkWriteBuffer;
20 20
21 /** 21 /**
22 * Describes how to interpret the alpha component of a pixel. 22 * Describes how to interpret the alpha component of a pixel.
23 */ 23 */
24 enum SkAlphaType { 24 enum SkAlphaType {
25 kUnknown_SkAlphaType, 25 kUnknown_SkAlphaType,
26 26
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 } 213 }
214 214
215 /** 215 /**
216 * Create an ImageInfo marked as SRGB with N32 swizzle. 216 * Create an ImageInfo marked as SRGB with N32 swizzle.
217 */ 217 */
218 static SkImageInfo MakeS32(int width, int height, SkAlphaType at); 218 static SkImageInfo MakeS32(int width, int height, SkAlphaType at);
219 219
220 /** 220 /**
221 * Sets colortype to the native ARGB32 type, and the alphatype to premul. 221 * Sets colortype to the native ARGB32 type, and the alphatype to premul.
222 */ 222 */
223 static SkImageInfo MakeN32Premul(int width, int height) { 223 static SkImageInfo MakeN32Premul(int width, int height, sk_sp<SkColorSpace> cs = nullptr) {
224 return Make(width, height, kN32_SkColorType, kPremul_SkAlphaType, nullpt r); 224 return Make(width, height, kN32_SkColorType, kPremul_SkAlphaType, cs);
225 } 225 }
226 226
227 static SkImageInfo MakeN32Premul(const SkISize& size) { 227 static SkImageInfo MakeN32Premul(const SkISize& size) {
228 return MakeN32Premul(size.width(), size.height()); 228 return MakeN32Premul(size.width(), size.height());
229 } 229 }
230 230
231 static SkImageInfo MakeA8(int width, int height) { 231 static SkImageInfo MakeA8(int width, int height) {
232 return Make(width, height, kAlpha_8_SkColorType, kPremul_SkAlphaType, nu llptr); 232 return Make(width, height, kAlpha_8_SkColorType, kPremul_SkAlphaType, nu llptr);
233 } 233 }
234 234
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
398 // Anything with a color-space attached is gamma-correct, as is F16. 398 // Anything with a color-space attached is gamma-correct, as is F16.
399 // To get legacy behavior, you need to ask for non-F16, with a nullptr color space. 399 // To get legacy behavior, you need to ask for non-F16, with a nullptr color space.
400 return (cs != nullptr) || kRGBA_F16_SkColorType == ct; 400 return (cs != nullptr) || kRGBA_F16_SkColorType == ct;
401 } 401 }
402 402
403 static inline bool SkImageInfoIsGammaCorrect(const SkImageInfo& info) { 403 static inline bool SkImageInfoIsGammaCorrect(const SkImageInfo& info) {
404 return SkColorAndColorSpaceAreGammaCorrect(info.colorType(), info.colorSpace ()); 404 return SkColorAndColorSpaceAreGammaCorrect(info.colorType(), info.colorSpace ());
405 } 405 }
406 406
407 #endif 407 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698