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

Side by Side Diff: src/core/SkBlitRow_D32.cpp

Issue 285313002: SSE2 implementation of memcpy32 (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase and fix comments Created 6 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 | « include/core/SkUtils.h ('k') | src/core/SkUtils.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 2011 Google Inc. 2 * Copyright 2011 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 "SkBlitRow.h" 8 #include "SkBlitRow.h"
9 #include "SkBlitMask.h" 9 #include "SkBlitMask.h"
10 #include "SkColorPriv.h" 10 #include "SkColorPriv.h"
11 #include "SkUtils.h" 11 #include "SkUtils.h"
12 12
13 #define UNROLL 13 #define UNROLL
14 14
15 SkBlitRow::ColorRectProc PlatformColorRectProcFactory(); 15 SkBlitRow::ColorRectProc PlatformColorRectProcFactory();
16 16
17 static void S32_Opaque_BlitRow32(SkPMColor* SK_RESTRICT dst, 17 static void S32_Opaque_BlitRow32(SkPMColor* SK_RESTRICT dst,
18 const SkPMColor* SK_RESTRICT src, 18 const SkPMColor* SK_RESTRICT src,
19 int count, U8CPU alpha) { 19 int count, U8CPU alpha) {
20 SkASSERT(255 == alpha); 20 SkASSERT(255 == alpha);
21 memcpy(dst, src, count * sizeof(SkPMColor)); 21 sk_memcpy32(dst, src, count);
22 } 22 }
23 23
24 static void S32_Blend_BlitRow32(SkPMColor* SK_RESTRICT dst, 24 static void S32_Blend_BlitRow32(SkPMColor* SK_RESTRICT dst,
25 const SkPMColor* SK_RESTRICT src, 25 const SkPMColor* SK_RESTRICT src,
26 int count, U8CPU alpha) { 26 int count, U8CPU alpha) {
27 SkASSERT(alpha <= 255); 27 SkASSERT(alpha <= 255);
28 if (count > 0) { 28 if (count > 0) {
29 unsigned src_scale = SkAlpha255To256(alpha); 29 unsigned src_scale = SkAlpha255To256(alpha);
30 unsigned dst_scale = 256 - src_scale; 30 unsigned dst_scale = 256 - src_scale;
31 31
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 } 240 }
241 241
242 SkBlitRow::ColorRectProc SkBlitRow::ColorRectProcFactory() { 242 SkBlitRow::ColorRectProc SkBlitRow::ColorRectProcFactory() {
243 SkBlitRow::ColorRectProc proc = PlatformColorRectProcFactory(); 243 SkBlitRow::ColorRectProc proc = PlatformColorRectProcFactory();
244 if (NULL == proc) { 244 if (NULL == proc) {
245 proc = ColorRect32; 245 proc = ColorRect32;
246 } 246 }
247 SkASSERT(proc); 247 SkASSERT(proc);
248 return proc; 248 return proc;
249 } 249 }
OLDNEW
« no previous file with comments | « include/core/SkUtils.h ('k') | src/core/SkUtils.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698