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

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

Issue 264603002: Cleanup of SSE optimization files. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Added chromium sync patch 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 | « src/opts/SkBlitRect_opts_SSE2.h ('k') | src/opts/SkBlitRow_opts_SSE2.h » ('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 <emmintrin.h>
8 #include "SkBlitRect_opts_SSE2.h" 9 #include "SkBlitRect_opts_SSE2.h"
9 #include "SkBlitRow.h" 10 #include "SkBlitRow.h"
10 #include "SkColorPriv.h" 11 #include "SkColorPriv.h"
11 12
12 #include <emmintrin.h> 13 /* Simple blitting of opaque rectangles less than 31 pixels wide:
13 14 * inlines and merges sections of Color32_SSE2 and sk_memset32_SSE2.
14 /** Simple blitting of opaque rectangles less than 31 pixels wide: 15 */
15 inlines and merges sections of Color32_SSE2 and sk_memset32_SSE2.
16 */
17 static void BlitRect32_OpaqueNarrow_SSE2(SkPMColor* SK_RESTRICT destination, 16 static void BlitRect32_OpaqueNarrow_SSE2(SkPMColor* SK_RESTRICT destination,
18 int width, int height, 17 int width, int height,
19 size_t rowBytes, uint32_t color) { 18 size_t rowBytes, uint32_t color) {
20 SkASSERT(255 == SkGetPackedA32(color)); 19 SkASSERT(255 == SkGetPackedA32(color));
21 SkASSERT(width > 0); 20 SkASSERT(width > 0);
22 SkASSERT(width < 31); 21 SkASSERT(width < 31);
23 22
24 while (--height >= 0) { 23 while (--height >= 0) {
25 SkPMColor* dst = destination; 24 SkPMColor* dst = destination;
26 int count = width; 25 int count = width;
27 26
28 while (count > 4) { 27 while (count > 4) {
29 *dst++ = color; 28 *dst++ = color;
30 *dst++ = color; 29 *dst++ = color;
31 *dst++ = color; 30 *dst++ = color;
32 *dst++ = color; 31 *dst++ = color;
33 count -= 4; 32 count -= 4;
34 } 33 }
35 34
36 while (count > 0) { 35 while (count > 0) {
37 *dst++ = color; 36 *dst++ = color;
38 --count; 37 --count;
39 } 38 }
40 39
41 destination = (uint32_t*)((char*)destination + rowBytes); 40 destination = (uint32_t*)((char*)destination + rowBytes);
42 } 41 }
43 } 42 }
44 43
45 /** 44 /*
46 Fast blitting of opaque rectangles at least 31 pixels wide: 45 * Fast blitting of opaque rectangles at least 31 pixels wide:
47 inlines and merges sections of Color32_SSE2 and sk_memset32_SSE2. 46 * inlines and merges sections of Color32_SSE2 and sk_memset32_SSE2.
48 A 31 pixel rectangle is guaranteed to have at least one 47 * A 31 pixel rectangle is guaranteed to have at least one
49 16-pixel aligned span that can take advantage of mm_store. 48 * 16-pixel aligned span that can take advantage of mm_store.
50 */ 49 */
51 static void BlitRect32_OpaqueWide_SSE2(SkPMColor* SK_RESTRICT destination, 50 static void BlitRect32_OpaqueWide_SSE2(SkPMColor* SK_RESTRICT destination,
52 int width, int height, 51 int width, int height,
53 size_t rowBytes, uint32_t color) { 52 size_t rowBytes, uint32_t color) {
54 SkASSERT(255 == SkGetPackedA32(color)); 53 SkASSERT(255 == SkGetPackedA32(color));
55 SkASSERT(width >= 31); 54 SkASSERT(width >= 31);
56 55
57 __m128i color_wide = _mm_set1_epi32(color); 56 __m128i color_wide = _mm_set1_epi32(color);
58 while (--height >= 0) { 57 while (--height >= 0) {
59 // Prefetching one row ahead to L1 cache can equal hardware 58 // Prefetching one row ahead to L1 cache can equal hardware
60 // performance for large/tall rects, but never *beats* 59 // performance for large/tall rects, but never *beats*
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 BlitRect32_OpaqueNarrow_SSE2(destination, width, height, 123 BlitRect32_OpaqueNarrow_SSE2(destination, width, height,
125 rowBytes, color); 124 rowBytes, color);
126 } else { 125 } else {
127 BlitRect32_OpaqueWide_SSE2(destination, width, height, 126 BlitRect32_OpaqueWide_SSE2(destination, width, height,
128 rowBytes, color); 127 rowBytes, color);
129 } 128 }
130 } else { 129 } else {
131 SkBlitRow::ColorRect32(destination, width, height, rowBytes, color); 130 SkBlitRow::ColorRect32(destination, width, height, rowBytes, color);
132 } 131 }
133 } 132 }
OLDNEW
« no previous file with comments | « src/opts/SkBlitRect_opts_SSE2.h ('k') | src/opts/SkBlitRow_opts_SSE2.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698