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

Unified Diff: src/opts/SkColorCubeFilter_opts.h

Issue 1526523003: Unify some SkNx code (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: typo Created 5 years 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/effects/gradients/SkRadialGradient.cpp ('k') | src/opts/SkNx_avx.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/opts/SkColorCubeFilter_opts.h
diff --git a/src/opts/SkColorCubeFilter_opts.h b/src/opts/SkColorCubeFilter_opts.h
index 4c394051bbae1e0f4f9f1534ca44217f572050ee..ab8d1d4c9bfec25bfb43f32223b019ab0e328ab1 100644
--- a/src/opts/SkColorCubeFilter_opts.h
+++ b/src/opts/SkColorCubeFilter_opts.h
@@ -59,10 +59,10 @@ void color_cube_filter_span(const SkPMColor src[],
const SkColor lutColor10 = colorCube[ix + i10];
const SkColor lutColor11 = colorCube[ix + i11];
- Sk4f sum = Sk4f::FromBytes((const uint8_t*)&lutColor00) * g0b0;
- sum = sum + Sk4f::FromBytes((const uint8_t*)&lutColor01) * g0b1;
- sum = sum + Sk4f::FromBytes((const uint8_t*)&lutColor10) * g1b0;
- sum = sum + Sk4f::FromBytes((const uint8_t*)&lutColor11) * g1b1;
+ Sk4f sum = SkNx_cast<float>(Sk4b::Load((const uint8_t*)&lutColor00)) * g0b0;
+ sum = sum + SkNx_cast<float>(Sk4b::Load((const uint8_t*)&lutColor01)) * g0b1;
+ sum = sum + SkNx_cast<float>(Sk4b::Load((const uint8_t*)&lutColor10)) * g1b0;
+ sum = sum + SkNx_cast<float>(Sk4b::Load((const uint8_t*)&lutColor11)) * g1b1;
color = color + sum * Sk4f((float)colorToFactors[x][r]);
}
if (a != 255) {
@@ -74,7 +74,7 @@ void color_cube_filter_span(const SkPMColor src[],
color = SkNx_shuffle<2,1,0,3>(color);
#endif
uint8_t* dstBytes = (uint8_t*)(dst+i);
- color.toBytes(dstBytes);
+ SkNx_cast<uint8_t>(color).store(dstBytes);
dstBytes[SK_A32_SHIFT/8] = a;
}
}
« no previous file with comments | « src/effects/gradients/SkRadialGradient.cpp ('k') | src/opts/SkNx_avx.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698