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

Side by Side Diff: src/core/SkMipMap.cpp

Issue 2067833003: Differentiate between sRGBGamma and 2Dot2Gamma (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix DefaultXform 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 | « src/core/SkColorSpace_Base.h ('k') | tests/ColorSpaceTest.cpp » ('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 #include "SkMipMap.h" 8 #include "SkMipMap.h"
9 #include "SkBitmap.h" 9 #include "SkBitmap.h"
10 #include "SkColorPriv.h" 10 #include "SkColorPriv.h"
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 } 299 }
300 int64_t size = sk_64_mul(levelCount + 1, sizeof(Level)) + pixelSize; 300 int64_t size = sk_64_mul(levelCount + 1, sizeof(Level)) + pixelSize;
301 if (!sk_64_isS32(size)) { 301 if (!sk_64_isS32(size)) {
302 return 0; 302 return 0;
303 } 303 }
304 return sk_64_asS32(size); 304 return sk_64_asS32(size);
305 } 305 }
306 306
307 static bool treat_like_srgb(const SkImageInfo& info) { 307 static bool treat_like_srgb(const SkImageInfo& info) {
308 if (info.colorSpace()) { 308 if (info.colorSpace()) {
309 return SkColorSpace::k2Dot2Curve_GammaNamed == info.colorSpace()->gammaN amed(); 309 return info.colorSpace()->gammaCloseToSRGB();
310 } else { 310 } else {
311 return kSRGB_SkColorProfileType == info.profileType(); 311 return kSRGB_SkColorProfileType == info.profileType();
312 } 312 }
313 } 313 }
314 314
315 SkMipMap* SkMipMap::Build(const SkPixmap& src, SkSourceGammaTreatment treatment, 315 SkMipMap* SkMipMap::Build(const SkPixmap& src, SkSourceGammaTreatment treatment,
316 SkDiscardableFactoryProc fact) { 316 SkDiscardableFactoryProc fact) {
317 typedef void FilterProc(void*, const void* srcPtr, size_t srcRB, int count); 317 typedef void FilterProc(void*, const void* srcPtr, size_t srcRB, int count);
318 318
319 FilterProc* proc_1_2 = nullptr; 319 FilterProc* proc_1_2 = nullptr;
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
633 return false; 633 return false;
634 } 634 }
635 if (index > fCount - 1) { 635 if (index > fCount - 1) {
636 return false; 636 return false;
637 } 637 }
638 if (levelPtr) { 638 if (levelPtr) {
639 *levelPtr = fLevels[index]; 639 *levelPtr = fLevels[index];
640 } 640 }
641 return true; 641 return true;
642 } 642 }
OLDNEW
« no previous file with comments | « src/core/SkColorSpace_Base.h ('k') | tests/ColorSpaceTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698