From bdb677a277e0285da5293adc0f1d40101fad4a69 Mon Sep 17 00:00:00 2001 From: "senorblanco@chromium.org" Date: Wed, 4 Dec 2013 19:53:41 +0000 Subject: Do proper NEON checking for SkBoxBlur procs. TBR=mtklein BUG= Review URL: https://codereview.chromium.org/98373003 git-svn-id: http://skia.googlecode.com/svn/trunk@12490 2bbb7eff-a529-9590-31e7-b0007b416f81 --- src/opts/SkBlurImage_opts_neon.cpp | 8 ++++---- src/opts/SkBlurImage_opts_neon.h | 13 +++++++++++++ src/opts/opts_check_arm.cpp | 17 +++++++++++++++++ 3 files changed, 34 insertions(+), 4 deletions(-) create mode 100644 src/opts/SkBlurImage_opts_neon.h (limited to 'src/opts') diff --git a/src/opts/SkBlurImage_opts_neon.cpp b/src/opts/SkBlurImage_opts_neon.cpp index a1d9cc18ac..14907ea1d2 100644 --- a/src/opts/SkBlurImage_opts_neon.cpp +++ b/src/opts/SkBlurImage_opts_neon.cpp @@ -92,10 +92,10 @@ void SkBoxBlur_NEON(const SkPMColor* src, int srcStride, SkPMColor* dst, int ker } // namespace -bool SkBoxBlurGetPlatformProcs(SkBoxBlurProc* boxBlurX, - SkBoxBlurProc* boxBlurY, - SkBoxBlurProc* boxBlurXY, - SkBoxBlurProc* boxBlurYX) { +bool SkBoxBlurGetPlatformProcs_NEON(SkBoxBlurProc* boxBlurX, + SkBoxBlurProc* boxBlurY, + SkBoxBlurProc* boxBlurXY, + SkBoxBlurProc* boxBlurYX) { *boxBlurX = SkBoxBlur_NEON; *boxBlurY = SkBoxBlur_NEON; *boxBlurXY = SkBoxBlur_NEON; diff --git a/src/opts/SkBlurImage_opts_neon.h b/src/opts/SkBlurImage_opts_neon.h new file mode 100644 index 0000000000..7fbe9633e6 --- /dev/null +++ b/src/opts/SkBlurImage_opts_neon.h @@ -0,0 +1,13 @@ +/* + * Copyright 2013 The Android Open Source Project + * + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +#include "SkBlurImage_opts.h" + +bool SkBoxBlurGetPlatformProcs_NEON(SkBoxBlurProc* boxBlurX, + SkBoxBlurProc* boxBlurY, + SkBoxBlurProc* boxBlurXY, + SkBoxBlurProc* boxBlurYX); diff --git a/src/opts/opts_check_arm.cpp b/src/opts/opts_check_arm.cpp index a9afa75b07..a9f7db7cb0 100644 --- a/src/opts/opts_check_arm.cpp +++ b/src/opts/opts_check_arm.cpp @@ -19,6 +19,7 @@ #include "SkUtilsArm.h" #include "SkMorphology_opts.h" #include "SkMorphology_opts_neon.h" +#include "SkBlurImage_opts_neon.h" #if defined(SK_CPU_LENDIAN) && !SK_ARM_NEON_IS_NONE extern "C" void memset16_neon(uint16_t dst[], uint16_t value, int count); @@ -91,3 +92,19 @@ SkMorphologyProc SkMorphologyGetPlatformProc(SkMorphologyProcType type) { } #endif } + +bool SkBoxBlurGetPlatformProcs(SkBoxBlurProc* boxBlurX, + SkBoxBlurProc* boxBlurY, + SkBoxBlurProc* boxBlurXY, + SkBoxBlurProc* boxBlurYX) { +#if SK_ARM_NEON_IS_NONE + return NULL; +#else +#if SK_ARM_NEON_IS_DYNAMIC + if (!sk_cpu_arm_has_neon()) { + return NULL; + } +#endif + return SkBoxBlurGetPlatformProcs_NEON(boxBlurX, boxBlurY, boxBlurXY, boxBlurYX); +#endif +} -- cgit v1.2.3