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

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

Issue 2086583002: update callers to not use SkColorProfileType (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rm flag instead of commenting it out 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/SkMipMap.cpp ('k') | src/effects/gradients/Sk4fLinearGradient.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 2016 Google Inc. 2 * Copyright 2016 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 "SkColorFilter.h" 8 #include "SkColorFilter.h"
9 #include "SkHalf.h" 9 #include "SkHalf.h"
10 #include "SkNx.h" 10 #include "SkNx.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 SkASSERT(src.addr64(x + count - 1, y)); 42 SkASSERT(src.addr64(x + count - 1, y));
43 43
44 for (int i = 0; i < count; ++i) { 44 for (int i = 0; i < count; ++i) {
45 SkHalfToFloat_01(addr[i]).store(span[i].fVec); 45 SkHalfToFloat_01(addr[i]).store(span[i].fVec);
46 } 46 }
47 } 47 }
48 48
49 SkLoadSpanProc SkLoadSpanProc_Choose(const SkImageInfo& info) { 49 SkLoadSpanProc SkLoadSpanProc_Choose(const SkImageInfo& info) {
50 switch (info.colorType()) { 50 switch (info.colorType()) {
51 case kN32_SkColorType: 51 case kN32_SkColorType:
52 return info.isSRGB() ? load_s32 : load_l32; 52 return info.gammaCloseToSRGB() ? load_s32 : load_l32;
53 case kRGBA_F16_SkColorType: 53 case kRGBA_F16_SkColorType:
54 return load_f16; 54 return load_f16;
55 default: 55 default:
56 return nullptr; 56 return nullptr;
57 } 57 }
58 } 58 }
59 59
60 //////////////////////////////////////////////////////////////////////////////// /////////////////// 60 //////////////////////////////////////////////////////////////////////////////// ///////////////////
61 61
62 static void noop_filterspan(const SkPaint& paint, SkPM4f[], int) { 62 static void noop_filterspan(const SkPaint& paint, SkPM4f[], int) {
(...skipping 23 matching lines...) Expand all
86 paint.getColorFilter()->filterSpan4f(span, count, span); 86 paint.getColorFilter()->filterSpan4f(span, count, span);
87 } 87 }
88 88
89 SkFilterSpanProc SkFilterSpanProc_Choose(const SkPaint& paint) { 89 SkFilterSpanProc SkFilterSpanProc_Choose(const SkPaint& paint) {
90 if (paint.getColorFilter()) { 90 if (paint.getColorFilter()) {
91 return 0xFF == paint.getAlpha() ? colorfilter_filterspan : colorfilter_a lpha_filterspan; 91 return 0xFF == paint.getAlpha() ? colorfilter_filterspan : colorfilter_a lpha_filterspan;
92 } else { 92 } else {
93 return 0xFF == paint.getAlpha() ? noop_filterspan : alpha_filterspan; 93 return 0xFF == paint.getAlpha() ? noop_filterspan : alpha_filterspan;
94 } 94 }
95 } 95 }
OLDNEW
« no previous file with comments | « src/core/SkMipMap.cpp ('k') | src/effects/gradients/Sk4fLinearGradient.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698