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

Side by Side Diff: src/effects/SkColorCubeFilter.cpp

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 | « no previous file | src/opts/SkColorCubeFilter_opts.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | src/opts/SkColorCubeFilter_opts.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698