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

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

Issue 1808963005: 4f linear gradient shader blitters (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: rename trunc_from_255 to quiet confused msvc Created 4 years, 9 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/SkUtils.h ('k') | src/effects/gradients/Sk4fGradientBase.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"
11 #include "SkXfermode.h" 11 #include "SkXfermode.h"
12 12
13 static void sk_memset64(uint64_t dst[], uint64_t value, int count) {
14 for (int i = 0; i < count; ++i) {
15 dst[i] = value;
16 }
17 }
18
19 enum DstType { 13 enum DstType {
20 kU16_Dst, 14 kU16_Dst,
21 kF16_Dst, 15 kF16_Dst,
22 }; 16 };
23 17
24 static Sk4f lerp_by_coverage(const Sk4f& src, const Sk4f& dst, uint8_t srcCovera ge) { 18 static Sk4f lerp_by_coverage(const Sk4f& src, const Sk4f& dst, uint8_t srcCovera ge) {
25 return dst + (src - dst) * Sk4f(srcCoverage * (1/255.0f)); 19 return dst + (src - dst) * Sk4f(srcCoverage * (1/255.0f));
26 } 20 }
27 21
28 template <DstType D> Sk4f unit_to_bias(const Sk4f& x4) { 22 template <DstType D> Sk4f unit_to_bias(const Sk4f& x4) {
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 flags &= 7; 240 flags &= 7;
247 241
248 Mode mode; 242 Mode mode;
249 return this->asMode(&mode) ? find_proc(mode, flags) : gProcs_General[flags]; 243 return this->asMode(&mode) ? find_proc(mode, flags) : gProcs_General[flags];
250 } 244 }
251 245
252 SkXfermode::D64Proc SkXfermode::GetD64Proc(SkXfermode* xfer, uint32_t flags) { 246 SkXfermode::D64Proc SkXfermode::GetD64Proc(SkXfermode* xfer, uint32_t flags) {
253 return xfer ? xfer->onGetD64Proc(flags) : find_proc(SkXfermode::kSrcOver_Mod e, flags); 247 return xfer ? xfer->onGetD64Proc(flags) : find_proc(SkXfermode::kSrcOver_Mod e, flags);
254 } 248 }
255 249
OLDNEW
« no previous file with comments | « src/core/SkUtils.h ('k') | src/effects/gradients/Sk4fGradientBase.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698