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

Side by Side Diff: src/opts/SkOpts_sse41.cpp

Issue 1939513002: Add specialized sRGB blitter for SkOpts (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix bad assert. Created 4 years, 7 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 unified diff | Download patch
« no previous file with comments | « src/opts/SkBlend_opts.h ('k') | tests/SkBlend_optsTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2015 Google Inc. 2 * Copyright 2015 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkOpts.h" 8 #include "SkOpts.h"
9 9
10 #define SK_OPTS_NS sk_sse41 10 #define SK_OPTS_NS sk_sse41
11 #include "SkBlurImageFilter_opts.h" 11 #include "SkBlurImageFilter_opts.h"
12 #include "SkBlitRow_opts.h" 12 #include "SkBlitRow_opts.h"
13 #include "SkBlend_opts.h"
13 14
14 #ifndef SK_SUPPORT_LEGACY_X86_BLITS 15 #ifndef SK_SUPPORT_LEGACY_X86_BLITS
15 16
16 namespace sk_sse41_new { 17 namespace sk_sse41_new {
17 18
18 // An SSE register holding at most 64 bits of useful data in the low lanes. 19 // An SSE register holding at most 64 bits of useful data in the low lanes.
19 struct m64i { 20 struct m64i {
20 __m128i v; 21 __m128i v;
21 /*implicit*/ m64i(__m128i v) : v(v) {} 22 /*implicit*/ m64i(__m128i v) : v(v) {}
22 operator __m128i() const { return v; } 23 operator __m128i() const { return v; }
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 // SrcOver blend mode, with coverage folded into source alpha. 205 // SrcOver blend mode, with coverage folded into source alpha.
205 __m128i sc = scale(s,c), 206 __m128i sc = scale(s,c),
206 AC = inv(alphas(sc)); 207 AC = inv(alphas(sc));
207 return _mm_add_epi16(sc, scale(d,AC)); 208 return _mm_add_epi16(sc, scale(d,AC));
208 })); 209 }));
209 dst += dstRB / sizeof(*dst); 210 dst += dstRB / sizeof(*dst);
210 cov += covRB / sizeof(*cov); 211 cov += covRB / sizeof(*cov);
211 } 212 }
212 } 213 }
213 } 214 }
214
215 } // namespace sk_sse41_new 215 } // namespace sk_sse41_new
216 216
217 #endif 217 #endif
218 218
219 namespace SkOpts { 219 namespace SkOpts {
220 void Init_sse41() { 220 void Init_sse41() {
221 box_blur_xx = sk_sse41::box_blur_xx; 221 box_blur_xx = sk_sse41::box_blur_xx;
222 box_blur_xy = sk_sse41::box_blur_xy; 222 box_blur_xy = sk_sse41::box_blur_xy;
223 box_blur_yx = sk_sse41::box_blur_yx; 223 box_blur_yx = sk_sse41::box_blur_yx;
224 srcover_srgb_srgb = sk_sse41::srcover_srgb_srgb;
224 225
225 #ifndef SK_SUPPORT_LEGACY_X86_BLITS 226 #ifndef SK_SUPPORT_LEGACY_X86_BLITS
226 blit_row_color32 = sk_sse41_new::blit_row_color32; 227 blit_row_color32 = sk_sse41_new::blit_row_color32;
227 blit_mask_d32_a8 = sk_sse41_new::blit_mask_d32_a8; 228 blit_mask_d32_a8 = sk_sse41_new::blit_mask_d32_a8;
228 #endif 229 #endif
229 blit_row_s32a_opaque = sk_sse41::blit_row_s32a_opaque; 230 blit_row_s32a_opaque = sk_sse41::blit_row_s32a_opaque;
230 } 231 }
231 } 232 }
OLDNEW
« no previous file with comments | « src/opts/SkBlend_opts.h ('k') | tests/SkBlend_optsTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698