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

Unified Diff: src/effects/gradients/SkLinearGradient.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/core/SkShader.cpp ('k') | src/effects/gradients/SkRadialGradient.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/gradients/SkLinearGradient.cpp
diff --git a/src/effects/gradients/SkLinearGradient.cpp b/src/effects/gradients/SkLinearGradient.cpp
index 4a27a35de47f79a81062517d9058525247cffe77..a1abe543c69a89f818d34279569776070b357bd9 100644
--- a/src/effects/gradients/SkLinearGradient.cpp
+++ b/src/effects/gradients/SkLinearGradient.cpp
@@ -287,10 +287,9 @@ void SkLinearGradient::LinearGradientContext::shadeSpan(int x, int y, SkPMColor*
SkGradFixed dx, fx = SkScalarToGradFixed(srcPt.fX);
if (fDstToIndexClass == kFixedStepInX_MatrixClass) {
- SkFixed dxStorage[1];
- (void)fDstToIndex.fixedStepInX(SkIntToScalar(y), dxStorage, nullptr);
+ const auto step = fDstToIndex.fixedStepInX(SkIntToScalar(y));
// todo: do we need a real/high-precision value for dx here?
- dx = SkFixedToGradFixed(dxStorage[0]);
+ dx = SkScalarToGradFixed(step.fX);
} else {
SkASSERT(fDstToIndexClass == kLinear_MatrixClass);
dx = SkScalarToGradFixed(fDstToIndex.getScaleX());
@@ -747,4 +746,3 @@ void SkLinearGradient::LinearGradientContext::shade4_clamp(int x, int y, SkPMCol
}
}
}
-
« no previous file with comments | « src/core/SkShader.cpp ('k') | src/effects/gradients/SkRadialGradient.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698