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

Unified Diff: src/core/SkScan_Hairline.cpp

Issue 1167153002: Remove overly-promiscuous SkNx syntax sugar. (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: update test Created 5 years, 6 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/SkRect.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/core/SkScan_Hairline.cpp
diff --git a/src/core/SkScan_Hairline.cpp b/src/core/SkScan_Hairline.cpp
index 4ed5ec254cc40ef6cb8597446f3bd473a52acd7d..eeac5cdc2fc2abd57436bf6e6c7d99a8ee05b679 100644
--- a/src/core/SkScan_Hairline.cpp
+++ b/src/core/SkScan_Hairline.cpp
@@ -233,7 +233,7 @@ static void hairquad(const SkPoint pts[3], const SkRegion* clip,
Sk2s B = Sk2s::Load(&coeff[1].fX);
Sk2s C = Sk2s::Load(&coeff[2].fX);
for (int i = 1; i < lines; ++i) {
- t += dt;
+ t = t + dt;
((A * t + B) * t + C).store(&tmp[i].fX);
}
tmp[lines] = pts[2];
@@ -241,7 +241,7 @@ static void hairquad(const SkPoint pts[3], const SkRegion* clip,
}
static inline Sk2s abs(const Sk2s& value) {
- return Sk2s::Max(value, -value);
+ return Sk2s::Max(value, Sk2s(0)-value);
}
static inline SkScalar max_component(const Sk2s& value) {
@@ -298,7 +298,7 @@ static void hair_cubic(const SkPoint pts[4], const SkRegion* clip, SkBlitter* bl
SkPoint coeff[4];
SkCubicToCoeff(pts, coeff);
-
+
const Sk2s dt(SK_Scalar1 / lines);
Sk2s t(0);
@@ -311,7 +311,7 @@ static void hair_cubic(const SkPoint pts[4], const SkRegion* clip, SkBlitter* bl
Sk2s C = Sk2s::Load(&coeff[2].fX);
Sk2s D = Sk2s::Load(&coeff[3].fX);
for (int i = 1; i < lines; ++i) {
- t += dt;
+ t = t + dt;
(((A * t + B) * t + C) * t + D).store(&tmp[i].fX);
}
tmp[lines] = pts[3];
« no previous file with comments | « src/core/SkRect.cpp ('k') | src/effects/gradients/SkRadialGradient.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698