diff options
author | mtklein <mtklein@chromium.org> | 2015-09-10 14:16:07 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-09-10 14:16:07 -0700 |
commit | a1c0ee40040fa8bb06f5f68ba4bcb3a68f789924 (patch) | |
tree | 5dc5cb538490e254f4fab6f88fe459dd0c5d7ec4 /src/opts | |
parent | e66fec23afb0e7c02a49baecb2be678abf3a8a63 (diff) |
SkNx_shuffle
This allows us to express shuffles more directly in code while also giving us a
convenient point to platform-specify particular shuffles for particular types.
No specializations yet. Everyone just uses the (pretty good) default option.
BUG=skia:
Review URL: https://codereview.chromium.org/1301413006
Diffstat (limited to 'src/opts')
-rw-r--r-- | src/opts/SkColorCubeFilter_opts.h | 2 | ||||
-rw-r--r-- | src/opts/SkXfermode_opts.h | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/opts/SkColorCubeFilter_opts.h b/src/opts/SkColorCubeFilter_opts.h index 3eb243de55..4c394051bb 100644 --- a/src/opts/SkColorCubeFilter_opts.h +++ b/src/opts/SkColorCubeFilter_opts.h @@ -71,7 +71,7 @@ void color_cube_filter_span(const SkPMColor src[], // color is BGRA (SkColor order), dst is SkPMColor order, so may need to swap R+B. #if defined(SK_PMCOLOR_IS_RGBA) - color = Sk4f(color.kth<2>(), color.kth<1>(), color.kth<0>(), color.kth<3>()); + color = SkNx_shuffle<2,1,0,3>(color); #endif uint8_t* dstBytes = (uint8_t*)(dst+i); color.toBytes(dstBytes); diff --git a/src/opts/SkXfermode_opts.h b/src/opts/SkXfermode_opts.h index 50bef6ac46..69f2b420f5 100644 --- a/src/opts/SkXfermode_opts.h +++ b/src/opts/SkXfermode_opts.h @@ -117,7 +117,7 @@ static inline Sk4f a_rgb(const Sk4f& a, const Sk4f& rgb) { return a * Sk4f(0,0,0,1) + rgb * Sk4f(1,1,1,0); } static inline Sk4f alphas(const Sk4f& f) { - return Sk4f(f.kth<SK_A32_SHIFT/8>()); + return SkNx_dup<SK_A32_SHIFT/8>(f); } XFERMODE(ColorDodge) { |