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

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

Issue 2072813002: Revert of Lots of progress switching to SkColorSpace rather than SkColorProfileType (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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
« no previous file with comments | « include/core/SkBitmap.h ('k') | include/core/SkPixelRef.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 , fWidth(width) 372 , fWidth(width)
373 , fHeight(height) 373 , fHeight(height)
374 , fColorType(ct) 374 , fColorType(ct)
375 , fAlphaType(at) 375 , fAlphaType(at)
376 , fProfileType(pt) 376 , fProfileType(pt)
377 {} 377 {}
378 }; 378 };
379 379
380 /////////////////////////////////////////////////////////////////////////////// 380 ///////////////////////////////////////////////////////////////////////////////
381 381
382 static inline bool SkColorAndColorSpaceAreGammaCorrect(SkColorType ct, SkColorSp ace* cs) { 382 static inline bool SkColorAndProfileAreGammaCorrect(SkColorType ct, SkColorProfi leType pt) {
383 // Anything with a color-space attached is gamma-correct, as is F16. 383 return kSRGB_SkColorProfileType == pt || kRGBA_F16_SkColorType == ct;
384 // To get legacy behavior, you need to ask for non-F16, with a nullptr color space.
385 return (cs != nullptr) || kRGBA_F16_SkColorType == ct;
386 } 384 }
387 385
388 static inline bool SkImageInfoIsGammaCorrect(const SkImageInfo& info) { 386 static inline bool SkImageInfoIsGammaCorrect(const SkImageInfo& info) {
389 return SkColorAndColorSpaceAreGammaCorrect(info.colorType(), info.colorSpace ()); 387 return SkColorAndProfileAreGammaCorrect(info.colorType(), info.profileType() );
390 } 388 }
391 389
392 #endif 390 #endif
OLDNEW
« no previous file with comments | « include/core/SkBitmap.h ('k') | include/core/SkPixelRef.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698