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

Side by Side Diff: src/image/SkSurface_Raster.cpp

Issue 2318663003: Delete SkColorSpace::gammaNamed() from public API (Closed) Base URL: https://skia.googlesource.com/skia.git@delunknownnamed
Patch Set: Rebase Created 4 years, 3 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/image/SkSurface_Gpu.cpp ('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 2012 Google Inc. 2 * Copyright 2012 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 "SkSurface_Base.h" 8 #include "SkSurface_Base.h"
9 #include "SkImagePriv.h" 9 #include "SkImagePriv.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 } 60 }
61 shift = 1; 61 shift = 1;
62 break; 62 break;
63 case kN32_SkColorType: 63 case kN32_SkColorType:
64 if (info.colorSpace() && !info.colorSpace()->gammaCloseToSRGB()) { 64 if (info.colorSpace() && !info.colorSpace()->gammaCloseToSRGB()) {
65 return false; 65 return false;
66 } 66 }
67 shift = 2; 67 shift = 2;
68 break; 68 break;
69 case kRGBA_F16_SkColorType: 69 case kRGBA_F16_SkColorType:
70 if (!info.colorSpace() || 70 if (!info.colorSpace() || !info.colorSpace()->gammaIsLinear()) {
71 SkColorSpace::kLinear_GammaNamed != info.colorSpace()->gammaName d()) {
72 return false; 71 return false;
73 } 72 }
74 shift = 3; 73 shift = 3;
75 break; 74 break;
76 default: 75 default:
77 return false; 76 return false;
78 } 77 }
79 78
80 if (kIgnoreRowBytesValue == rowBytes) { 79 if (kIgnoreRowBytesValue == rowBytes) {
81 return true; 80 return true;
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 210
212 SkAutoTUnref<SkPixelRef> pr(SkMallocPixelRef::NewZeroed(info, rowBytes, null ptr)); 211 SkAutoTUnref<SkPixelRef> pr(SkMallocPixelRef::NewZeroed(info, rowBytes, null ptr));
213 if (nullptr == pr.get()) { 212 if (nullptr == pr.get()) {
214 return nullptr; 213 return nullptr;
215 } 214 }
216 if (rowBytes) { 215 if (rowBytes) {
217 SkASSERT(pr->rowBytes() == rowBytes); 216 SkASSERT(pr->rowBytes() == rowBytes);
218 } 217 }
219 return sk_make_sp<SkSurface_Raster>(pr, props); 218 return sk_make_sp<SkSurface_Raster>(pr, props);
220 } 219 }
OLDNEW
« no previous file with comments | « src/image/SkSurface_Gpu.cpp ('k') | tests/ColorSpaceTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698