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

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

Issue 2052943002: SkPixmap::setColorSpace (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: std::move() 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/SkDraw.h ('k') | include/core/SkPixmap.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 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 } 273 }
274 274
275 SkImageInfo makeAlphaType(SkAlphaType newAlphaType) const { 275 SkImageInfo makeAlphaType(SkAlphaType newAlphaType) const {
276 return SkImageInfo(fWidth, fHeight, fColorType, newAlphaType, fProfileTy pe, fColorSpace); 276 return SkImageInfo(fWidth, fHeight, fColorType, newAlphaType, fProfileTy pe, fColorSpace);
277 } 277 }
278 278
279 SkImageInfo makeColorType(SkColorType newColorType) const { 279 SkImageInfo makeColorType(SkColorType newColorType) const {
280 return SkImageInfo(fWidth, fHeight, newColorType, fAlphaType, fProfileTy pe, fColorSpace); 280 return SkImageInfo(fWidth, fHeight, newColorType, fAlphaType, fProfileTy pe, fColorSpace);
281 } 281 }
282 282
283 SkImageInfo makeColorSpace(sk_sp<SkColorSpace> cs) const {
284 return SkImageInfo::Make(fWidth, fHeight, fColorType, fAlphaType, std::m ove(cs));
285 }
286
283 int bytesPerPixel() const { return SkColorTypeBytesPerPixel(fColorType); } 287 int bytesPerPixel() const { return SkColorTypeBytesPerPixel(fColorType); }
284 288
285 int shiftPerPixel() const { return SkColorTypeShiftPerPixel(fColorType); } 289 int shiftPerPixel() const { return SkColorTypeShiftPerPixel(fColorType); }
286 290
287 uint64_t minRowBytes64() const { 291 uint64_t minRowBytes64() const {
288 return sk_64_mul(fWidth, this->bytesPerPixel()); 292 return sk_64_mul(fWidth, this->bytesPerPixel());
289 } 293 }
290 294
291 size_t minRowBytes() const { 295 size_t minRowBytes() const {
292 return (size_t)this->minRowBytes64(); 296 return (size_t)this->minRowBytes64();
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
366 370
367 static inline bool SkColorAndProfileAreGammaCorrect(SkColorType ct, SkColorProfi leType pt) { 371 static inline bool SkColorAndProfileAreGammaCorrect(SkColorType ct, SkColorProfi leType pt) {
368 return kSRGB_SkColorProfileType == pt || kRGBA_F16_SkColorType == ct; 372 return kSRGB_SkColorProfileType == pt || kRGBA_F16_SkColorType == ct;
369 } 373 }
370 374
371 static inline bool SkImageInfoIsGammaCorrect(const SkImageInfo& info) { 375 static inline bool SkImageInfoIsGammaCorrect(const SkImageInfo& info) {
372 return SkColorAndProfileAreGammaCorrect(info.colorType(), info.profileType() ); 376 return SkColorAndProfileAreGammaCorrect(info.colorType(), info.profileType() );
373 } 377 }
374 378
375 #endif 379 #endif
OLDNEW
« no previous file with comments | « include/core/SkDraw.h ('k') | include/core/SkPixmap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698