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

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

Issue 2029373004: respect srgb gamma when building mips (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: address comments from #4 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
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 } 278 }
279 279
280 SkImageInfo makeAlphaType(SkAlphaType newAlphaType) const { 280 SkImageInfo makeAlphaType(SkAlphaType newAlphaType) const {
281 return SkImageInfo(fWidth, fHeight, fColorType, newAlphaType, fProfileTy pe, fColorSpace); 281 return SkImageInfo(fWidth, fHeight, fColorType, newAlphaType, fProfileTy pe, fColorSpace);
282 } 282 }
283 283
284 SkImageInfo makeColorType(SkColorType newColorType) const { 284 SkImageInfo makeColorType(SkColorType newColorType) const {
285 return SkImageInfo(fWidth, fHeight, newColorType, fAlphaType, fProfileTy pe, fColorSpace); 285 return SkImageInfo(fWidth, fHeight, newColorType, fAlphaType, fProfileTy pe, fColorSpace);
286 } 286 }
287 287
288 SkImageInfo makeColorSpace(sk_sp<SkColorSpace> cs) const {
289 return SkImageInfo::Make(fWidth, fHeight, fColorType, fAlphaType, std::m ove(cs));
290 }
291
288 int bytesPerPixel() const { return SkColorTypeBytesPerPixel(fColorType); } 292 int bytesPerPixel() const { return SkColorTypeBytesPerPixel(fColorType); }
289 293
290 int shiftPerPixel() const { return SkColorTypeShiftPerPixel(fColorType); } 294 int shiftPerPixel() const { return SkColorTypeShiftPerPixel(fColorType); }
291 295
292 uint64_t minRowBytes64() const { 296 uint64_t minRowBytes64() const {
293 return sk_64_mul(fWidth, this->bytesPerPixel()); 297 return sk_64_mul(fWidth, this->bytesPerPixel());
294 } 298 }
295 299
296 size_t minRowBytes() const { 300 size_t minRowBytes() const {
297 return (size_t)this->minRowBytes64(); 301 return (size_t)this->minRowBytes64();
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 375
372 static inline bool SkColorAndProfileAreGammaCorrect(SkColorType ct, SkColorProfi leType pt) { 376 static inline bool SkColorAndProfileAreGammaCorrect(SkColorType ct, SkColorProfi leType pt) {
373 return kSRGB_SkColorProfileType == pt || kRGBA_F16_SkColorType == ct; 377 return kSRGB_SkColorProfileType == pt || kRGBA_F16_SkColorType == ct;
374 } 378 }
375 379
376 static inline bool SkImageInfoIsGammaCorrect(const SkImageInfo& info) { 380 static inline bool SkImageInfoIsGammaCorrect(const SkImageInfo& info) {
377 return SkColorAndProfileAreGammaCorrect(info.colorType(), info.profileType() ); 381 return SkColorAndProfileAreGammaCorrect(info.colorType(), info.profileType() );
378 } 382 }
379 383
380 #endif 384 #endif
OLDNEW
« no previous file with comments | « gm/showmiplevels.cpp ('k') | include/core/SkPixmap.h » ('j') | src/gpu/SkGr.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698