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

Side by Side Diff: src/opts/SkColorCubeFilter_opts.h

Issue 2145833002: Update SkOpts namespaces. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: static, just in case 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/opts/SkBlurImageFilter_opts.h ('k') | src/opts/SkOpts_avx.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 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef SkColorCubeFilter_opts_DEFINED 5 #ifndef SkColorCubeFilter_opts_DEFINED
6 #define SkColorCubeFilter_opts_DEFINED 6 #define SkColorCubeFilter_opts_DEFINED
7 7
8 #include "SkColor.h" 8 #include "SkColor.h"
9 #include "SkNx.h" 9 #include "SkNx.h"
10 #include "SkUnPreMultiply.h" 10 #include "SkUnPreMultiply.h"
11 11
12 namespace SK_OPTS_NS { 12 namespace SK_OPTS_NS {
13 13
14 void color_cube_filter_span(const SkPMColor src[], 14 static void color_cube_filter_span(const SkPMColor src[],
15 int count, 15 int count,
16 SkPMColor dst[], 16 SkPMColor dst[],
17 const int* colorToIndex[2], 17 const int* colorToIndex[2],
18 const SkScalar* colorToFactors[2], 18 const SkScalar* colorToFactors[2],
19 int dim, 19 int dim,
20 const SkColor* colorCube) { 20 const SkColor* colorCube) {
21 uint8_t r, g, b, a; 21 uint8_t r, g, b, a;
22 22
23 for (int i = 0; i < count; ++i) { 23 for (int i = 0; i < count; ++i) {
24 const SkPMColor input = src[i]; 24 const SkPMColor input = src[i];
25 a = input >> SK_A32_SHIFT; 25 a = input >> SK_A32_SHIFT;
26 26
27 if (a != 255) { 27 if (a != 255) {
28 const SkColor source = SkUnPreMultiply::PMColorToColor(input); 28 const SkColor source = SkUnPreMultiply::PMColorToColor(input);
29 r = SkColorGetR(source); 29 r = SkColorGetR(source);
30 g = SkColorGetG(source); 30 g = SkColorGetG(source);
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 #endif 75 #endif
76 uint8_t* dstBytes = (uint8_t*)(dst+i); 76 uint8_t* dstBytes = (uint8_t*)(dst+i);
77 SkNx_cast<uint8_t>(color).store(dstBytes); 77 SkNx_cast<uint8_t>(color).store(dstBytes);
78 dstBytes[SK_A32_SHIFT/8] = a; 78 dstBytes[SK_A32_SHIFT/8] = a;
79 } 79 }
80 } 80 }
81 81
82 } // namespace SK_OPTS NS 82 } // namespace SK_OPTS NS
83 83
84 #endif // SkColorCubeFilter_opts_DEFINED 84 #endif // SkColorCubeFilter_opts_DEFINED
OLDNEW
« no previous file with comments | « src/opts/SkBlurImageFilter_opts.h ('k') | src/opts/SkOpts_avx.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698