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

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

Issue 68123003: Implement a NEON version of morphology. This is good for ~2.2X speedup on Tegra3. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Implement runtime NEON detection. 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_neon.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 (c) 2010, Code Aurora Forum. All rights reserved. 2 * Copyright (c) 2010, Code Aurora Forum. All rights reserved.
3 * Copyright 2006-2010, The Android Open Source Project 3 * Copyright 2006-2010, The Android Open Source Project
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 ***************************************************************************/ 7 ***************************************************************************/
8 8
9 /* Changes: 9 /* Changes:
10 * 2011-04-01 ARM 10 * 2011-04-01 ARM
11 * Merged the functions from src/opts/opts_check_arm_neon.cpp 11 * Merged the functions from src/opts/opts_check_arm_neon.cpp
12 * Modified to return ARM version of memset16 and memset32 if no neon 12 * Modified to return ARM version of memset16 and memset32 if no neon
13 * available in the core 13 * available in the core
14 */ 14 */
15 15
16 #include "SkBlitRow.h" 16 #include "SkBlitRow.h"
17 #include "SkUtils.h" 17 #include "SkUtils.h"
18 18
19 #include "SkUtilsArm.h" 19 #include "SkUtilsArm.h"
20 #include "SkMorphology_opts.h"
21 #include "SkMorphology_opts_neon.h"
20 22
21 #if defined(SK_CPU_LENDIAN) && !SK_ARM_NEON_IS_NONE 23 #if defined(SK_CPU_LENDIAN) && !SK_ARM_NEON_IS_NONE
22 extern "C" void memset16_neon(uint16_t dst[], uint16_t value, int count); 24 extern "C" void memset16_neon(uint16_t dst[], uint16_t value, int count);
23 extern "C" void memset32_neon(uint32_t dst[], uint32_t value, int count); 25 extern "C" void memset32_neon(uint32_t dst[], uint32_t value, int count);
24 #endif 26 #endif
25 27
26 #if defined(SK_CPU_LENDIAN) 28 #if defined(SK_CPU_LENDIAN)
27 extern "C" void arm_memset16(uint16_t* dst, uint16_t value, int count); 29 extern "C" void arm_memset16(uint16_t* dst, uint16_t value, int count);
28 extern "C" void arm_memset32(uint32_t* dst, uint32_t value, int count); 30 extern "C" void arm_memset32(uint32_t* dst, uint32_t value, int count);
29 #endif 31 #endif
(...skipping 28 matching lines...) Expand all
58 #elif SK_ARM_NEON_IS_ALWAYS 60 #elif SK_ARM_NEON_IS_ALWAYS
59 return memset32_neon; 61 return memset32_neon;
60 #else 62 #else
61 return arm_memset32; 63 return arm_memset32;
62 #endif 64 #endif
63 } 65 }
64 66
65 SkBlitRow::ColorRectProc PlatformColorRectProcFactory() { 67 SkBlitRow::ColorRectProc PlatformColorRectProcFactory() {
66 return NULL; 68 return NULL;
67 } 69 }
70
71 SkMorphologyProc SkMorphologyGetPlatformProc(SkMorphologyProcType type) {
mtklein 2013/11/11 16:05:55 I think for completeness' sake, this wants to be:
72 #if SK_ARM_NEON_IS_DYNAMIC
73 if (!sk_cpu_arm_has_neon()) {
74 return NULL;
75 }
76 #endif
77 switch (type) {
78 case kDilateX_SkMorphologyProcType:
79 return SkDilateX_neon;
80 case kDilateY_SkMorphologyProcType:
81 return SkDilateY_neon;
82 case kErodeX_SkMorphologyProcType:
83 return SkErodeX_neon;
84 case kErodeY_SkMorphologyProcType:
85 return SkErodeY_neon;
86 default:
87 return NULL;
88 }
89 }
OLDNEW
« no previous file with comments | « src/opts/SkMorphology_opts_neon.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698