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

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

Issue 1314763007: SkColorCubeFilter_opts: start with a statically-initializable zero. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 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 | « no previous file | no next file » | 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 "SkPMFloat.h" 9 #include "SkPMFloat.h"
10 #include "SkUnPreMultiply.h" 10 #include "SkUnPreMultiply.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 const Sk4f g0b0(g0*b0), 44 const Sk4f g0b0(g0*b0),
45 g0b1(g0*b1), 45 g0b1(g0*b1),
46 g1b0(g1*b0), 46 g1b0(g1*b0),
47 g1b1(g1*b1); 47 g1b1(g1*b1);
48 48
49 const int i00 = (colorToIndex[0][g] + colorToIndex[0][b] * dim) * dim; 49 const int i00 = (colorToIndex[0][g] + colorToIndex[0][b] * dim) * dim;
50 const int i01 = (colorToIndex[0][g] + colorToIndex[1][b] * dim) * dim; 50 const int i01 = (colorToIndex[0][g] + colorToIndex[1][b] * dim) * dim;
51 const int i10 = (colorToIndex[1][g] + colorToIndex[0][b] * dim) * dim; 51 const int i10 = (colorToIndex[1][g] + colorToIndex[0][b] * dim) * dim;
52 const int i11 = (colorToIndex[1][g] + colorToIndex[1][b] * dim) * dim; 52 const int i11 = (colorToIndex[1][g] + colorToIndex[1][b] * dim) * dim;
53 53
54 SkPMFloat color(0); 54 SkPMFloat color(0,0,0,0);
Noel Gordon 2015/08/27 13:31:50 My earlier test patches did it this way too. Agree
55 55
56 for (int x = 0; x < 2; ++x) { 56 for (int x = 0; x < 2; ++x) {
57 const int ix = colorToIndex[x][r]; 57 const int ix = colorToIndex[x][r];
58 58
59 const SkColor lutColor00 = colorCube[ix + i00]; 59 const SkColor lutColor00 = colorCube[ix + i00];
60 const SkColor lutColor01 = colorCube[ix + i01]; 60 const SkColor lutColor01 = colorCube[ix + i01];
61 const SkColor lutColor10 = colorCube[ix + i10]; 61 const SkColor lutColor10 = colorCube[ix + i10];
62 const SkColor lutColor11 = colorCube[ix + i11]; 62 const SkColor lutColor11 = colorCube[ix + i11];
63 63
64 Sk4f sum = SkPMFloat::FromOpaqueColor(lutColor00) * g0b0; 64 Sk4f sum = SkPMFloat::FromOpaqueColor(lutColor00) * g0b0;
(...skipping 11 matching lines...) Expand all
76 dst[i] = color.round(); 76 dst[i] = color.round();
77 77
78 ptr_dst[SK_A32_SHIFT / 8] = a; 78 ptr_dst[SK_A32_SHIFT / 8] = a;
79 ptr_dst += 4; 79 ptr_dst += 4;
80 } 80 }
81 } 81 }
82 82
83 } // namespace SK_OPTS NS 83 } // namespace SK_OPTS NS
84 84
85 #endif // SkColorCubeFilter_opts_DEFINED 85 #endif // SkColorCubeFilter_opts_DEFINED
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698