Cleanup the ARM blitrow optimizations
authordjsollen@google.com <djsollen@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Fri, 9 Aug 2013 12:35:08 +0000 (12:35 +0000)
committerdjsollen@google.com <djsollen@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Fri, 9 Aug 2013 12:35:08 +0000 (12:35 +0000)
R=mtklein@google.com

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

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

src/opts/SkBlitRow_opts_arm.cpp
src/opts/SkBlitRow_opts_arm.h [deleted file]
src/opts/SkBlitRow_opts_arm_neon.cpp
src/opts/SkBlitRow_opts_arm_neon.h [new file with mode: 0644]

index 50b4984..8eb7b1c 100644 (file)
@@ -5,17 +5,26 @@
  * found in the LICENSE file.
  */
 
-#include "SkBlitRow_opts_arm.h"
-
 #include "SkBlitMask.h"
 #include "SkBlitRow.h"
 #include "SkColorPriv.h"
 #include "SkDither.h"
 #include "SkMathPriv.h"
 #include "SkUtils.h"
+#include "SkUtilsArm.h"
 
 #include "SkCachePreload_arm.h"
 
+// Define USE_NEON_CODE to indicate that we need to build NEON routines
+#define USE_NEON_CODE  (!SK_ARM_NEON_IS_NONE)
+
+// Define USE_ARM_CODE to indicate that we need to build ARM routines
+#define USE_ARM_CODE   (!SK_ARM_NEON_IS_ALWAYS)
+
+#if USE_NEON_CODE
+  #include "SkBlitRow_opts_arm_neon.h"
+#endif
+
 #if USE_ARM_CODE
 
 static void S32A_D565_Opaque(uint16_t* SK_RESTRICT dst,
@@ -185,12 +194,10 @@ static void S32A_Opaque_BlitRow32_arm(SkPMColor* SK_RESTRICT dst,
                   : "cc", "r4", "r5", "r6", "r7", "r8", "r9", "r10", "ip", "memory"
                   );
 }
-#endif // USE_ARM_CODE
 
 /*
  * ARM asm version of S32A_Blend_BlitRow32
  */
-// This version is also used by the NEON procs table, so always compile it
 void S32A_Blend_BlitRow32_arm(SkPMColor* SK_RESTRICT dst,
                               const SkPMColor* SK_RESTRICT src,
                               int count, U8CPU alpha) {
@@ -331,8 +338,7 @@ void S32A_Blend_BlitRow32_arm(SkPMColor* SK_RESTRICT dst,
 
 ///////////////////////////////////////////////////////////////////////////////
 
-#if USE_ARM_CODE
-const SkBlitRow::Proc sk_blitrow_platform_565_procs_arm[] = {
+static const SkBlitRow::Proc sk_blitrow_platform_565_procs_arm[] = {
     // no dither
     // NOTE: For the functions below, we don't have a special version
     //       that assumes that each source pixel is opaque. But our S32A is
@@ -349,13 +355,14 @@ const SkBlitRow::Proc sk_blitrow_platform_565_procs_arm[] = {
     NULL,   // S32A_D565_Blend_Dither
 };
 
-const SkBlitRow::Proc32 sk_blitrow_platform_32_procs_arm[] = {
+static const SkBlitRow::Proc32 sk_blitrow_platform_32_procs_arm[] = {
     NULL,   // S32_Opaque,
     NULL,   // S32_Blend,
     S32A_Opaque_BlitRow32_arm,   // S32A_Opaque,
     S32A_Blend_BlitRow32_arm     // S32A_Blend
 };
-#endif
+
+#endif // USE_ARM_CODE
 
 SkBlitRow::Proc SkBlitRow::PlatformProcs565(unsigned flags) {
     return SK_ARM_NEON_WRAP(sk_blitrow_platform_565_procs_arm)[flags];
diff --git a/src/opts/SkBlitRow_opts_arm.h b/src/opts/SkBlitRow_opts_arm.h
deleted file mode 100644 (file)
index 25f8bf4..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright 2012 Google Inc.
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-#ifndef SkBlitRow_opts_arm_DEFINED
-#define SkBlitRow_opts_arm_DEFINED
-
-#include "SkBlitRow.h"
-#include "SkUtilsArm.h"
-
-// Define USE_NEON_CODE to indicate that we need to build NEON routines
-#define USE_NEON_CODE  (!SK_ARM_NEON_IS_NONE)
-
-// Define USE_ARM_CODE to indicate that we need to build ARM routines
-#define USE_ARM_CODE   (!SK_ARM_NEON_IS_ALWAYS)
-
-#if USE_NEON_CODE
-// These are defined in SkBlitRow_opts_arm_neon.cpp
-extern const SkBlitRow::Proc sk_blitrow_platform_565_procs_arm_neon[];
-extern const SkBlitRow::Proc32 sk_blitrow_platform_32_procs_arm_neon[];
-
-extern void Color32_arm_neon(SkPMColor* dst, const SkPMColor* src, int count,
-                             SkPMColor color);
-#endif
-
-#if USE_ARM_CODE
-// These are defined in SkBlitRow_opts_arm.cpp
-extern const SkBlitRow::Proc sk_blitrow_platform_565_procs_arm[];
-extern const SkBlitRow::Proc32 sk_blitrow_platform_32_procs_arm[];
-#endif
-
-// Defined in SkBlitRow_opts_arm.cpp, used in all cases.
-extern void S32A_Blend_BlitRow32_arm(SkPMColor* SK_RESTRICT dst,
-                                     const SkPMColor* SK_RESTRICT src,
-                                     int count, U8CPU alpha);
-
-#endif
index 200d85d..1bc0ea1 100644 (file)
@@ -5,7 +5,7 @@
  * found in the LICENSE file.
  */
 
-#include "SkBlitRow_opts_arm.h"
+#include "SkBlitRow_opts_arm_neon.h"
 
 #include "SkBlitMask.h"
 #include "SkBlitRow.h"
diff --git a/src/opts/SkBlitRow_opts_arm_neon.h b/src/opts/SkBlitRow_opts_arm_neon.h
new file mode 100644 (file)
index 0000000..80b8754
--- /dev/null
@@ -0,0 +1,18 @@
+/*
+ * Copyright 2012 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+#ifndef SkBlitRow_opts_arm_neon_DEFINED
+#define SkBlitRow_opts_arm_neon_DEFINED
+
+#include "SkBlitRow.h"
+
+extern const SkBlitRow::Proc sk_blitrow_platform_565_procs_arm_neon[];
+extern const SkBlitRow::Proc32 sk_blitrow_platform_32_procs_arm_neon[];
+
+extern void Color32_arm_neon(SkPMColor* dst, const SkPMColor* src, int count,
+                             SkPMColor color);
+
+#endif