Split opts_check_arm.cpp into per-class files
authorcommit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>
Mon, 10 Feb 2014 15:01:05 +0000 (15:01 +0000)
committercommit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>
Mon, 10 Feb 2014 15:01:05 +0000 (15:01 +0000)
Signed-off-by: Kévin PETIT <kevin.petit@arm.com>
BUG=skia:
R=djsollen@google.com

Author: kevin.petit@arm.com

Review URL: https://codereview.chromium.org/157863003

git-svn-id: http://skia.googlecode.com/svn/trunk@13381 2bbb7eff-a529-9590-31e7-b0007b416f81

gyp/opts.gyp
src/opts/SkBlitRow_opts_arm.cpp
src/opts/SkBlurImage_opts_arm.cpp [new file with mode: 0644]
src/opts/SkMorphology_opts_arm.cpp [new file with mode: 0644]
src/opts/SkUtils_opts_arm.cpp [new file with mode: 0644]
src/opts/opts_check_arm.cpp [deleted file]

index 9fe4023ea621f51b5e9870c0b696966a9f04f428..0d3b2e3d6aae9153f0796976790c536ea16f4f16 100644 (file)
             'arm_neon_optional%': '<(arm_neon_optional>',
           },
           'sources': [
-            '../src/opts/opts_check_arm.cpp',
             '../src/opts/memset.arm.S',
             '../src/opts/SkBitmapProcState_opts_arm.cpp',
             '../src/opts/SkBlitMask_opts_arm.cpp',
             '../src/opts/SkBlitRow_opts_arm.cpp',
             '../src/opts/SkBlitRow_opts_arm.h',
+            '../src/opts/SkBlurImage_opts_arm.cpp',
+            '../src/opts/SkMorphology_opts_arm.cpp',
+            '../src/opts/SkUtils_opts_arm.cpp',
             '../src/opts/SkXfermode_opts_arm.cpp',
           ],
           'conditions': [
index e8e544e9dcb3e98afcefa3ba4e46d6be32769048..c334e495def10914b4069ae847433938b3b78574 100644 (file)
@@ -376,3 +376,7 @@ SkBlitRow::Proc32 SkBlitRow::PlatformProcs32(unsigned flags) {
 SkBlitRow::ColorProc SkBlitRow::PlatformColorProc() {
     return SK_ARM_NEON_WRAP(Color32_arm);
 }
+
+SkBlitRow::ColorRectProc PlatformColorRectProcFactory() {
+    return NULL;
+}
diff --git a/src/opts/SkBlurImage_opts_arm.cpp b/src/opts/SkBlurImage_opts_arm.cpp
new file mode 100644 (file)
index 0000000..10d595a
--- /dev/null
@@ -0,0 +1,25 @@
+/*
+ * Copyright 2014 ARM Ltd.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#include "SkBlurImage_opts_neon.h"
+#include "SkUtilsArm.h"
+
+bool SkBoxBlurGetPlatformProcs(SkBoxBlurProc* boxBlurX,
+                               SkBoxBlurProc* boxBlurY,
+                               SkBoxBlurProc* boxBlurXY,
+                               SkBoxBlurProc* boxBlurYX) {
+#if SK_ARM_NEON_IS_NONE
+    return false;
+#else
+#if SK_ARM_NEON_IS_DYNAMIC
+    if (!sk_cpu_arm_has_neon()) {
+        return false;
+    }
+#endif
+    return SkBoxBlurGetPlatformProcs_NEON(boxBlurX, boxBlurY, boxBlurXY, boxBlurYX);
+#endif
+}
diff --git a/src/opts/SkMorphology_opts_arm.cpp b/src/opts/SkMorphology_opts_arm.cpp
new file mode 100644 (file)
index 0000000..2bba492
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2014 ARM Ltd.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#include "SkMorphology_opts.h"
+#include "SkMorphology_opts_neon.h"
+#include "SkUtilsArm.h"
+
+SkMorphologyImageFilter::Proc SkMorphologyGetPlatformProc(SkMorphologyProcType type) {
+#if SK_ARM_NEON_IS_NONE
+    return NULL;
+#else
+#if SK_ARM_NEON_IS_DYNAMIC
+    if (!sk_cpu_arm_has_neon()) {
+        return NULL;
+    }
+#endif
+    switch (type) {
+        case kDilateX_SkMorphologyProcType:
+            return SkDilateX_neon;
+        case kDilateY_SkMorphologyProcType:
+            return SkDilateY_neon;
+        case kErodeX_SkMorphologyProcType:
+            return SkErodeX_neon;
+        case kErodeY_SkMorphologyProcType:
+            return SkErodeY_neon;
+        default:
+            return NULL;
+    }
+#endif
+}
diff --git a/src/opts/SkUtils_opts_arm.cpp b/src/opts/SkUtils_opts_arm.cpp
new file mode 100644 (file)
index 0000000..2c57a3e
--- /dev/null
@@ -0,0 +1,53 @@
+/*
+ * Copyright 2014 ARM Ltd.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#include "SkUtils.h"
+#include "SkUtilsArm.h"
+
+#if defined(SK_CPU_LENDIAN) && !SK_ARM_NEON_IS_NONE
+extern "C" void memset16_neon(uint16_t dst[], uint16_t value, int count);
+extern "C" void memset32_neon(uint32_t dst[], uint32_t value, int count);
+#endif
+
+#if defined(SK_CPU_LENDIAN)
+extern "C" void arm_memset16(uint16_t* dst, uint16_t value, int count);
+extern "C" void arm_memset32(uint32_t* dst, uint32_t value, int count);
+#endif
+
+SkMemset16Proc SkMemset16GetPlatformProc() {
+    // FIXME: memset.arm.S is using syntax incompatible with XCode
+#if !defined(SK_CPU_LENDIAN) || defined(SK_BUILD_FOR_IOS)
+    return NULL;
+#elif SK_ARM_NEON_IS_DYNAMIC
+    if (sk_cpu_arm_has_neon()) {
+        return memset16_neon;
+    } else {
+        return arm_memset16;
+    }
+#elif SK_ARM_NEON_IS_ALWAYS
+    return memset16_neon;
+#else
+    return arm_memset16;
+#endif
+}
+
+SkMemset32Proc SkMemset32GetPlatformProc() {
+    // FIXME: memset.arm.S is using syntax incompatible with XCode
+#if !defined(SK_CPU_LENDIAN) || defined(SK_BUILD_FOR_IOS)
+    return NULL;
+#elif SK_ARM_NEON_IS_DYNAMIC
+    if (sk_cpu_arm_has_neon()) {
+        return memset32_neon;
+    } else {
+        return arm_memset32;
+    }
+#elif SK_ARM_NEON_IS_ALWAYS
+    return memset32_neon;
+#else
+    return arm_memset32;
+#endif
+}
diff --git a/src/opts/opts_check_arm.cpp b/src/opts/opts_check_arm.cpp
deleted file mode 100644 (file)
index 9e8b472..0000000
+++ /dev/null
@@ -1,110 +0,0 @@
-/***************************************************************************
- * Copyright (c) 2010, Code Aurora Forum. All rights reserved.
- * Copyright 2006-2010, 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.
- ***************************************************************************/
-
-/* Changes:
- * 2011-04-01 ARM
- *    Merged the functions from src/opts/opts_check_arm_neon.cpp
- *    Modified to return ARM version of memset16 and memset32 if no neon
- *    available in the core
- */
-
-#include "SkBlitRow.h"
-#include "SkUtils.h"
-
-#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);
-extern "C" void memset32_neon(uint32_t dst[], uint32_t value, int count);
-#endif
-
-#if defined(SK_CPU_LENDIAN)
-extern "C" void arm_memset16(uint16_t* dst, uint16_t value, int count);
-extern "C" void arm_memset32(uint32_t* dst, uint32_t value, int count);
-#endif
-
-SkMemset16Proc SkMemset16GetPlatformProc() {
-    // FIXME: memset.arm.S is using syntax incompatible with XCode
-#if !defined(SK_CPU_LENDIAN) || defined(SK_BUILD_FOR_IOS)
-    return NULL;
-#elif SK_ARM_NEON_IS_DYNAMIC
-    if (sk_cpu_arm_has_neon()) {
-        return memset16_neon;
-    } else {
-        return arm_memset16;
-    }
-#elif SK_ARM_NEON_IS_ALWAYS
-    return memset16_neon;
-#else
-    return arm_memset16;
-#endif
-}
-
-SkMemset32Proc SkMemset32GetPlatformProc() {
-    // FIXME: memset.arm.S is using syntax incompatible with XCode
-#if !defined(SK_CPU_LENDIAN) || defined(SK_BUILD_FOR_IOS)
-    return NULL;
-#elif SK_ARM_NEON_IS_DYNAMIC
-    if (sk_cpu_arm_has_neon()) {
-        return memset32_neon;
-    } else {
-        return arm_memset32;
-    }
-#elif SK_ARM_NEON_IS_ALWAYS
-    return memset32_neon;
-#else
-    return arm_memset32;
-#endif
-}
-
-SkBlitRow::ColorRectProc PlatformColorRectProcFactory() {
-    return NULL;
-}
-
-SkMorphologyImageFilter::Proc SkMorphologyGetPlatformProc(SkMorphologyProcType type) {
-#if SK_ARM_NEON_IS_NONE
-    return NULL;
-#else
-#if SK_ARM_NEON_IS_DYNAMIC
-    if (!sk_cpu_arm_has_neon()) {
-        return NULL;
-    }
-#endif
-    switch (type) {
-        case kDilateX_SkMorphologyProcType:
-            return SkDilateX_neon;
-        case kDilateY_SkMorphologyProcType:
-            return SkDilateY_neon;
-        case kErodeX_SkMorphologyProcType:
-            return SkErodeX_neon;
-        case kErodeY_SkMorphologyProcType:
-            return SkErodeY_neon;
-        default:
-            return NULL;
-    }
-#endif
-}
-
-bool SkBoxBlurGetPlatformProcs(SkBoxBlurProc* boxBlurX,
-                               SkBoxBlurProc* boxBlurY,
-                               SkBoxBlurProc* boxBlurXY,
-                               SkBoxBlurProc* boxBlurYX) {
-#if SK_ARM_NEON_IS_NONE
-    return false;
-#else
-#if SK_ARM_NEON_IS_DYNAMIC
-    if (!sk_cpu_arm_has_neon()) {
-        return false;
-    }
-#endif
-    return SkBoxBlurGetPlatformProcs_NEON(boxBlurX, boxBlurY, boxBlurXY, boxBlurYX);
-#endif
-}