| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #include "SkColorCubeFilter.h" | 8 #include "SkColorCubeFilter.h" |
| 9 #include "SkColorPriv.h" | 9 #include "SkColorPriv.h" |
| 10 #include "SkOnce.h" | 10 #include "SkOnce.h" |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 } | 124 } |
| 125 | 125 |
| 126 void SkColorCubeFilter::filterSpan(const SkPMColor src[], int count, SkPMColor d
st[]) const { | 126 void SkColorCubeFilter::filterSpan(const SkPMColor src[], int count, SkPMColor d
st[]) const { |
| 127 const int* colorToIndex[2]; | 127 const int* colorToIndex[2]; |
| 128 const SkScalar* colorToFactors[2]; | 128 const SkScalar* colorToFactors[2]; |
| 129 const SkScalar* colorToScalar; | 129 const SkScalar* colorToScalar; |
| 130 fCache.getProcessingLuts(&colorToIndex, &colorToFactors, &colorToScalar); | 130 fCache.getProcessingLuts(&colorToIndex, &colorToFactors, &colorToScalar); |
| 131 | 131 |
| 132 SkOpts::color_cube_filter_span(src, count, dst, colorToIndex, | 132 SkOpts::color_cube_filter_span(src, count, dst, colorToIndex, |
| 133 colorToFactors, fCache.cubeDimension(), | 133 colorToFactors, fCache.cubeDimension(), |
| 134 (SkColor*)fCubeData->data()); | 134 (const SkColor*)fCubeData->data()); |
| 135 } | 135 } |
| 136 | 136 |
| 137 SkFlattenable* SkColorCubeFilter::CreateProc(SkReadBuffer& buffer) { | 137 SkFlattenable* SkColorCubeFilter::CreateProc(SkReadBuffer& buffer) { |
| 138 int cubeDimension = buffer.readInt(); | 138 int cubeDimension = buffer.readInt(); |
| 139 SkAutoDataUnref cubeData(buffer.readByteArrayAsData()); | 139 SkAutoDataUnref cubeData(buffer.readByteArrayAsData()); |
| 140 if (!buffer.validate(is_valid_3D_lut(cubeData, cubeDimension))) { | 140 if (!buffer.validate(is_valid_3D_lut(cubeData, cubeDimension))) { |
| 141 return NULL; | 141 return NULL; |
| 142 } | 142 } |
| 143 return Create(cubeData, cubeDimension); | 143 return Create(cubeData, cubeDimension); |
| 144 } | 144 } |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 333 *array->append() = frag; | 333 *array->append() = frag; |
| 334 } else { | 334 } else { |
| 335 frag->unref(); | 335 frag->unref(); |
| 336 SkDEBUGCODE(frag = NULL;) | 336 SkDEBUGCODE(frag = NULL;) |
| 337 } | 337 } |
| 338 return true; | 338 return true; |
| 339 } | 339 } |
| 340 return false; | 340 return false; |
| 341 } | 341 } |
| 342 #endif | 342 #endif |
| OLD | NEW |