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

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

Issue 52603004: Implement SSE2-based implementations of the morphology filters (dilate & (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Tweak Created 7 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « src/opts/SkMorphology_opts_none.cpp ('k') | no next file » | 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 2009 The Android Open Source Project 2 * Copyright 2009 The Android Open Source Project
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 "SkBitmapProcState_opts_SSE2.h" 8 #include "SkBitmapProcState_opts_SSE2.h"
9 #include "SkBitmapProcState_opts_SSSE3.h" 9 #include "SkBitmapProcState_opts_SSSE3.h"
10 #include "SkBitmapFilter_opts_SSE2.h" 10 #include "SkBitmapFilter_opts_SSE2.h"
11 #include "SkBlitMask.h" 11 #include "SkBlitMask.h"
12 #include "SkBlitRow.h" 12 #include "SkBlitRow.h"
13 #include "SkBlitRect_opts_SSE2.h" 13 #include "SkBlitRect_opts_SSE2.h"
14 #include "SkBlitRow_opts_SSE2.h" 14 #include "SkBlitRow_opts_SSE2.h"
15 #include "SkUtils_opts_SSE2.h" 15 #include "SkUtils_opts_SSE2.h"
16 #include "SkUtils.h" 16 #include "SkUtils.h"
17 #include "SkMorphology_opts.h"
18 #include "SkMorphology_opts_SSE2.h"
17 19
18 #include "SkRTConf.h" 20 #include "SkRTConf.h"
19 21
20 #if defined(_MSC_VER) && defined(_WIN64) 22 #if defined(_MSC_VER) && defined(_WIN64)
21 #include <intrin.h> 23 #include <intrin.h>
22 #endif 24 #endif
23 25
24 /* This file must *not* be compiled with -msse or -msse2, otherwise 26 /* This file must *not* be compiled with -msse or -msse2, otherwise
25 gcc may generate sse2 even for scalar ops (and thus give an invalid 27 gcc may generate sse2 even for scalar ops (and thus give an invalid
26 instruction on Pentium3 on the code below). Only files named *_SSE2.cpp 28 instruction on Pentium3 on the code below). Only files named *_SSE2.cpp
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 } 243 }
242 244
243 SkMemset32Proc SkMemset32GetPlatformProc() { 245 SkMemset32Proc SkMemset32GetPlatformProc() {
244 if (cachedHasSSE2()) { 246 if (cachedHasSSE2()) {
245 return sk_memset32_SSE2; 247 return sk_memset32_SSE2;
246 } else { 248 } else {
247 return NULL; 249 return NULL;
248 } 250 }
249 } 251 }
250 252
253 SkMorphologyProc SkMorphologyGetPlatformProc(SkMorphologyProcType type) {
254 if (!cachedHasSSE2()) {
255 return NULL;
256 }
257 switch (type) {
258 case kDilateX_SkMorphologyProcType:
259 return SkDilateX_SSE2;
260 case kDilateY_SkMorphologyProcType:
261 return SkDilateY_SSE2;
262 case kErodeX_SkMorphologyProcType:
263 return SkErodeX_SSE2;
264 case kErodeY_SkMorphologyProcType:
265 return SkErodeY_SSE2;
266 default:
267 return NULL;
268 }
269 }
270
251 SkBlitRow::ColorRectProc PlatformColorRectProcFactory(); // suppress warning 271 SkBlitRow::ColorRectProc PlatformColorRectProcFactory(); // suppress warning
252 272
253 SkBlitRow::ColorRectProc PlatformColorRectProcFactory() { 273 SkBlitRow::ColorRectProc PlatformColorRectProcFactory() {
254 if (cachedHasSSE2()) { 274 if (cachedHasSSE2()) {
255 return ColorRect32_SSE2; 275 return ColorRect32_SSE2;
256 } else { 276 } else {
257 return NULL; 277 return NULL;
258 } 278 }
259 } 279 }
OLDNEW
« no previous file with comments | « src/opts/SkMorphology_opts_none.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698