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

Side by Side Diff: src/effects/gradients/SkRadialGradient.cpp

Issue 1692013002: Change SkMatrix::fixedStepInX to return SkVector rather than SkFixed. (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: Split fixedStepInX into bool isFixedStepInX and SkVector fixedStepInX. Created 4 years, 10 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/gradients/SkLinearGradient.cpp ('k') | src/effects/gradients/SkSweepGradient.cpp » ('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 /* 2 /*
3 * Copyright 2012 Google Inc. 3 * Copyright 2012 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 8
9 #include "SkRadialGradient.h" 9 #include "SkRadialGradient.h"
10 #include "SkNx.h" 10 #include "SkNx.h"
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 const SkPMColor* SK_RESTRICT cache = fCache->getCache32(); 199 const SkPMColor* SK_RESTRICT cache = fCache->getCache32();
200 int toggle = init_dither_toggle(x, y); 200 int toggle = init_dither_toggle(x, y);
201 201
202 if (fDstToIndexClass != kPerspective_MatrixClass) { 202 if (fDstToIndexClass != kPerspective_MatrixClass) {
203 dstProc(fDstToIndex, SkIntToScalar(x) + SK_ScalarHalf, 203 dstProc(fDstToIndex, SkIntToScalar(x) + SK_ScalarHalf,
204 SkIntToScalar(y) + SK_ScalarHalf, &srcPt); 204 SkIntToScalar(y) + SK_ScalarHalf, &srcPt);
205 SkScalar sdx = fDstToIndex.getScaleX(); 205 SkScalar sdx = fDstToIndex.getScaleX();
206 SkScalar sdy = fDstToIndex.getSkewY(); 206 SkScalar sdy = fDstToIndex.getSkewY();
207 207
208 if (fDstToIndexClass == kFixedStepInX_MatrixClass) { 208 if (fDstToIndexClass == kFixedStepInX_MatrixClass) {
209 SkFixed storage[2]; 209 const auto step = fDstToIndex.fixedStepInX(SkIntToScalar(y));
210 (void)fDstToIndex.fixedStepInX(SkIntToScalar(y), 210 sdx = step.fX;
211 &storage[0], &storage[1]); 211 sdy = step.fY;
212 sdx = SkFixedToScalar(storage[0]);
213 sdy = SkFixedToScalar(storage[1]);
214 } else { 212 } else {
215 SkASSERT(fDstToIndexClass == kLinear_MatrixClass); 213 SkASSERT(fDstToIndexClass == kLinear_MatrixClass);
216 } 214 }
217 215
218 RadialShadeProc shadeProc = shadeSpan_radial_repeat; 216 RadialShadeProc shadeProc = shadeSpan_radial_repeat;
219 if (SkShader::kClamp_TileMode == radialGradient.fTileMode) { 217 if (SkShader::kClamp_TileMode == radialGradient.fTileMode) {
220 shadeProc = shadeSpan_radial_clamp2; 218 shadeProc = shadeSpan_radial_clamp2;
221 } else if (SkShader::kMirror_TileMode == radialGradient.fTileMode) { 219 } else if (SkShader::kMirror_TileMode == radialGradient.fTileMode) {
222 shadeProc = shadeSpan_radial_mirror; 220 shadeProc = shadeSpan_radial_mirror;
223 } else { 221 } else {
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
378 str->appendScalar(fCenter.fY); 376 str->appendScalar(fCenter.fY);
379 str->append(") radius: "); 377 str->append(") radius: ");
380 str->appendScalar(fRadius); 378 str->appendScalar(fRadius);
381 str->append(" "); 379 str->append(" ");
382 380
383 this->INHERITED::toString(str); 381 this->INHERITED::toString(str);
384 382
385 str->append(")"); 383 str->append(")");
386 } 384 }
387 #endif 385 #endif
OLDNEW
« no previous file with comments | « src/effects/gradients/SkLinearGradient.cpp ('k') | src/effects/gradients/SkSweepGradient.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698