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

Unified Diff: src/core/SkScan_Hairline.cpp

Issue 1633143002: move more geometry to simd (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: confirmed that only gm tests that call cubic eval change Created 4 years, 11 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/SkGeometry.cpp ('k') | src/utils/SkPatchUtils.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 12553a4a54f1d1e1fbd78d54edce348bd7adb82e..efccfc9ee82e6e6e554881bcef879a262d4c7085 100644
--- a/src/core/SkScan_Hairline.cpp
+++ b/src/core/SkScan_Hairline.cpp
@@ -218,8 +218,7 @@ static void hairquad(const SkPoint pts[3], const SkRegion* clip,
SkBlitter* blitter, int level, SkScan::HairRgnProc lineproc) {
SkASSERT(level <= kMaxQuadSubdivideLevel);
- SkPoint coeff[3];
- SkQuadToCoeff(pts, coeff);
+ SkQuadCoeff coeff(pts);
const int lines = 1 << level;
Sk2s t(0);
@@ -229,9 +228,9 @@ static void hairquad(const SkPoint pts[3], const SkRegion* clip,
SkASSERT((unsigned)lines < SK_ARRAY_COUNT(tmp));
tmp[0] = pts[0];
- Sk2s A = Sk2s::Load(&coeff[0].fX);
- Sk2s B = Sk2s::Load(&coeff[1].fX);
- Sk2s C = Sk2s::Load(&coeff[2].fX);
+ Sk2s A = coeff.fA;
+ Sk2s B = coeff.fB;
+ Sk2s C = coeff.fC;
for (int i = 1; i < lines; ++i) {
t = t + dt;
((A * t + B) * t + C).store(&tmp[i].fX);
@@ -296,8 +295,7 @@ static void hair_cubic(const SkPoint pts[4], const SkRegion* clip, SkBlitter* bl
return;
}
- SkPoint coeff[4];
- SkCubicToCoeff(pts, coeff);
+ SkCubicCoeff coeff(pts);
const Sk2s dt(SK_Scalar1 / lines);
Sk2s t(0);
@@ -306,10 +304,10 @@ static void hair_cubic(const SkPoint pts[4], const SkRegion* clip, SkBlitter* bl
SkASSERT((unsigned)lines < SK_ARRAY_COUNT(tmp));
tmp[0] = pts[0];
- Sk2s A = Sk2s::Load(&coeff[0].fX);
- Sk2s B = Sk2s::Load(&coeff[1].fX);
- Sk2s C = Sk2s::Load(&coeff[2].fX);
- Sk2s D = Sk2s::Load(&coeff[3].fX);
+ Sk2s A = coeff.fA;
+ Sk2s B = coeff.fB;
+ Sk2s C = coeff.fC;
+ Sk2s D = coeff.fD;
for (int i = 1; i < lines; ++i) {
t = t + dt;
(((A * t + B) * t + C) * t + D).store(&tmp[i].fX);
« no previous file with comments | « src/core/SkGeometry.cpp ('k') | src/utils/SkPatchUtils.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698