OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 #include "SkColorMatrixFilter.h" | 8 #include "SkColorMatrixFilter.h" |
9 #include "SkColorMatrix.h" | 9 #include "SkColorMatrix.h" |
10 #include "SkColorPriv.h" | 10 #include "SkColorPriv.h" |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 fProc = shiftIs16 ? Add16 : Add; | 179 fProc = shiftIs16 ? Add16 : Add; |
180 } else { | 180 } else { |
181 fProc = NULL; // identity | 181 fProc = NULL; // identity |
182 } | 182 } |
183 } | 183 } |
184 | 184 |
185 /* preround our add values so we get a rounded shift. We do this after we | 185 /* preround our add values so we get a rounded shift. We do this after we |
186 analyze the array, so we don't miss the case where the caller has zeros | 186 analyze the array, so we don't miss the case where the caller has zeros |
187 which could make us accidentally take the General or Add case. | 187 which could make us accidentally take the General or Add case. |
188 */ | 188 */ |
189 if (NULL != fProc) { | 189 if (fProc) { |
190 int32_t add = 1 << (fState.fShift - 1); | 190 int32_t add = 1 << (fState.fShift - 1); |
191 array[4] += add; | 191 array[4] += add; |
192 array[9] += add; | 192 array[9] += add; |
193 array[14] += add; | 193 array[14] += add; |
194 array[19] += add; | 194 array[19] += add; |
195 } | 195 } |
196 } | 196 } |
197 | 197 |
198 /////////////////////////////////////////////////////////////////////////////// | 198 /////////////////////////////////////////////////////////////////////////////// |
199 | 199 |
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
502 str->append("matrix: ("); | 502 str->append("matrix: ("); |
503 for (int i = 0; i < 20; ++i) { | 503 for (int i = 0; i < 20; ++i) { |
504 str->appendScalar(fMatrix.fMat[i]); | 504 str->appendScalar(fMatrix.fMat[i]); |
505 if (i < 19) { | 505 if (i < 19) { |
506 str->append(", "); | 506 str->append(", "); |
507 } | 507 } |
508 } | 508 } |
509 str->append(")"); | 509 str->append(")"); |
510 } | 510 } |
511 #endif | 511 #endif |
OLD | NEW |