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

Unified Diff: src/opts/SkRasterPipeline_opts.h

Issue 2480823002: skrpb: evaluate color filters for constant shaders once. (Closed)
Patch Set: Created 4 years, 1 month 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/opts/SkNx_sse.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/opts/SkRasterPipeline_opts.h
diff --git a/src/opts/SkRasterPipeline_opts.h b/src/opts/SkRasterPipeline_opts.h
index bd42632b4b0cfb6ac049e15a41a2f589041b8f3c..155558e776de5d08705dd39c08db82a81133ae44 100644
--- a/src/opts/SkRasterPipeline_opts.h
+++ b/src/opts/SkRasterPipeline_opts.h
@@ -23,9 +23,9 @@ namespace {
static constexpr int N = 4;
#endif
-using SkNf = SkNx<N, float>;
-using SkNi = SkNx<N, int>;
-using SkNh = SkNx<N, uint16_t>;
+ using SkNf = SkNx<N, float>;
+ using SkNi = SkNx<N, int>;
+ using SkNh = SkNx<N, uint16_t>;
struct BodyStage;
struct TailStage;
@@ -379,6 +379,24 @@ STAGE(store_f16, false) {
}
}
+STAGE(store_f32, false) {
+ auto ptr = *(SkPM4f**)ctx + x;
+
+ SkPM4f buf[8];
+ SkNf::Store4(kIsTail ? buf : ptr, r,g,b,a);
+ if (kIsTail) {
+ switch (tail & (N-1)) {
+ case 7: ptr[6] = buf[6];
+ case 6: ptr[5] = buf[5];
+ case 5: ptr[4] = buf[4];
+ case 4: ptr[3] = buf[3];
+ case 3: ptr[2] = buf[2];
+ case 2: ptr[1] = buf[1];
+ }
+ ptr[0] = buf[0];
+ }
+}
+
// Load 8-bit SkPMColor-order sRGB.
STAGE(load_d_srgb, true) {
« no previous file with comments | « src/opts/SkNx_sse.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698