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

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

Issue 2138073002: Clean up hyper-local SkCpu feature test experiment. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 5 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/SkHalf.h ('k') | src/opts/SkNx_sse.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 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 "SkHalf.h" 8 #include "SkHalf.h"
9 #include "SkPM4fPriv.h" 9 #include "SkPM4fPriv.h"
10 #include "SkUtils.h" 10 #include "SkUtils.h"
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 } else { 128 } else {
129 dst[i] = SkFloatToHalf_01(r4); 129 dst[i] = SkFloatToHalf_01(r4);
130 } 130 }
131 } 131 }
132 } 132 }
133 133
134 static void srcover_n(const SkXfermode*, uint64_t dst[], const SkPM4f src[], int count, 134 static void srcover_n(const SkXfermode*, uint64_t dst[], const SkPM4f src[], int count,
135 const SkAlpha aa[]) { 135 const SkAlpha aa[]) {
136 for (int i = 0; i < count; ++i) { 136 for (int i = 0; i < count; ++i) {
137 Sk4f s = Sk4f::Load(src+i), 137 Sk4f s = Sk4f::Load(src+i),
138 d = SkHalfToFloat_01(dst+i), 138 d = SkHalfToFloat_01(dst[i]),
139 r = s + d*(1.0f - SkNx_shuffle<3,3,3,3>(s)); 139 r = s + d*(1.0f - SkNx_shuffle<3,3,3,3>(s));
140 if (aa) { 140 if (aa) {
141 r = lerp_by_coverage(r, d, aa[i]); 141 r = lerp_by_coverage(r, d, aa[i]);
142 } 142 }
143 SkFloatToHalf_01(r, dst+i); 143 dst[i] = SkFloatToHalf_01(r);
144 } 144 }
145 } 145 }
146 146
147 const SkXfermode::F16Proc gProcs_SrcOver[] = { srcover_n, src_n, srcover_1, src_ 1 }; 147 const SkXfermode::F16Proc gProcs_SrcOver[] = { srcover_n, src_n, srcover_1, src_ 1 };
148 148
149 //////////////////////////////////////////////////////////////////////////////// /////////////////// 149 //////////////////////////////////////////////////////////////////////////////// ///////////////////
150 150
151 static SkXfermode::F16Proc find_proc(SkXfermode::Mode mode, uint32_t flags) { 151 static SkXfermode::F16Proc find_proc(SkXfermode::Mode mode, uint32_t flags) {
152 SkASSERT(0 == (flags & ~3)); 152 SkASSERT(0 == (flags & ~3));
153 flags &= 3; 153 flags &= 3;
(...skipping 13 matching lines...) Expand all
167 SkASSERT(0 == (flags & ~3)); 167 SkASSERT(0 == (flags & ~3));
168 flags &= 3; 168 flags &= 3;
169 169
170 Mode mode; 170 Mode mode;
171 return this->asMode(&mode) ? find_proc(mode, flags) : gProcs_General[flags]; 171 return this->asMode(&mode) ? find_proc(mode, flags) : gProcs_General[flags];
172 } 172 }
173 173
174 SkXfermode::F16Proc SkXfermode::GetF16Proc(SkXfermode* xfer, uint32_t flags) { 174 SkXfermode::F16Proc SkXfermode::GetF16Proc(SkXfermode* xfer, uint32_t flags) {
175 return xfer ? xfer->onGetF16Proc(flags) : find_proc(SkXfermode::kSrcOver_Mod e, flags); 175 return xfer ? xfer->onGetF16Proc(flags) : find_proc(SkXfermode::kSrcOver_Mod e, flags);
176 } 176 }
OLDNEW
« no previous file with comments | « src/core/SkHalf.h ('k') | src/opts/SkNx_sse.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698