OLD | NEW |
---|---|
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 Loading... | |
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 Loading... | |
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 |
OLD | NEW |