OLD | NEW |
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 Loading... |
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 } |
OLD | NEW |