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

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

Issue 1288323004: Patches on top of Radu's latest. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: noel Created 5 years, 4 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/effects/SkColorCubeFilter.cpp ('k') | 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 63
64 Sk4f sum = SkPMFloat::FromBGRx(lutColor00) * g0b0; 64 Sk4f sum = SkPMFloat::FromBGRx(lutColor00) * g0b0;
65 sum = sum + SkPMFloat::FromBGRx(lutColor01) * g0b1; 65 sum = sum + SkPMFloat::FromBGRx(lutColor01) * g0b1;
66 sum = sum + SkPMFloat::FromBGRx(lutColor10) * g1b0; 66 sum = sum + SkPMFloat::FromBGRx(lutColor10) * g1b0;
67 sum = sum + SkPMFloat::FromBGRx(lutColor11) * g1b1; 67 sum = sum + SkPMFloat::FromBGRx(lutColor11) * g1b1;
68 68
69 color = color + sum * Sk4f((float)colorToFactors[x][r]); 69 color = color + sum * Sk4f((float)colorToFactors[x][r]);
70 } 70 }
71 71
72 if (a != 255) { 72 if (a != 255) {
73 color = color * Sk4f(((float)a) / 255); 73 color = color * Sk4f(a * 1.0f/255);
74 } 74 }
75 75
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 | « src/effects/SkColorCubeFilter.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698