From 3b8d9f776e476746b38c0dca674e497d7c4b13cb Mon Sep 17 00:00:00 2001 From: mtklein Date: Fri, 22 May 2015 05:51:37 -0700 Subject: [PATCH] Revert of Re-proc SkBlitRow::Color32 for ARM. (patchset #3 id:40001 of https://codereview.chromium.org/1145283003/) Reason for revert: http://build.chromium.org/p/tryserver.chromium.mac/builders/ios_rel_device_ninja/builds/70016/steps/compile%20%28with%20patch%29/logs/stdio Original issue's description: > Re-proc SkBlitRow::Color32 for ARM. > > This is a spiritual revert of http://crrev.com/1104183004. > > BUG=skia: > > Committed: https://skia.googlesource.com/skia/+/4e13a23d8f720e17660f26657b45b89fe4339004 TBR=reed@google.com,mtklein@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Review URL: https://codereview.chromium.org/1157633003 --- include/core/SkBlitRow.h | 3 --- src/core/SkBlitRow_D32.cpp | 5 ----- src/opts/SkBlitRow_opts_arm.cpp | 4 ---- src/opts/SkBlitRow_opts_arm_neon.cpp | 17 ----------------- src/opts/SkBlitRow_opts_arm_neon.h | 2 -- 5 files changed, 31 deletions(-) diff --git a/include/core/SkBlitRow.h b/include/core/SkBlitRow.h index 8c7665ac54..56121eba78 100644 --- a/include/core/SkBlitRow.h +++ b/include/core/SkBlitRow.h @@ -82,9 +82,6 @@ public: static ColorProc16 PlatformColorFactory565(unsigned flags); private: - typedef void (*Color32Proc)(SkPMColor[], const SkPMColor[], int, SkPMColor); - static Color32Proc PlatformColor32Proc(); - enum { kFlags16_Mask = 7, kFlags32_Mask = 3 diff --git a/src/core/SkBlitRow_D32.cpp b/src/core/SkBlitRow_D32.cpp index 07a5d875b8..f5cb45d0fa 100644 --- a/src/core/SkBlitRow_D32.cpp +++ b/src/core/SkBlitRow_D32.cpp @@ -144,11 +144,6 @@ void SkBlitRow::Color32(SkPMColor dst[], const SkPMColor src[], int count, SkPMC case 255: sk_memset32(dst, color, count); return; } - // This Sk4px impl works great on other platforms or when we have NEON. -#if defined(SK_CPU_ARM32) && !defined(SK_ARM_HAS_NEON) - if (auto proc = PlatformColor32Proc()) { return proc(dst, src, count, color); } -#endif - unsigned invA = 255 - SkGetPackedA32(color); invA += invA >> 7; SkASSERT(invA < 256); // We've already handled alpha == 0 above. diff --git a/src/opts/SkBlitRow_opts_arm.cpp b/src/opts/SkBlitRow_opts_arm.cpp index 3dc99ce5b1..9dd4b3b43d 100644 --- a/src/opts/SkBlitRow_opts_arm.cpp +++ b/src/opts/SkBlitRow_opts_arm.cpp @@ -390,7 +390,3 @@ SkBlitRow::Proc32 SkBlitRow::PlatformProcs32(unsigned flags) { return SK_ARM_NEON_WRAP(sk_blitrow_platform_32_procs_arm)[flags]; } -SkBlitRow::Color32Proc SkBlitRow::PlatformColor32Proc() { - #define sk_blitrow_color32_arm NULL - return SK_ARM_NEON_WRAP(sk_blitrow_color32_arm); -} diff --git a/src/opts/SkBlitRow_opts_arm_neon.cpp b/src/opts/SkBlitRow_opts_arm_neon.cpp index 93bd8516e3..4a6514af7f 100644 --- a/src/opts/SkBlitRow_opts_arm_neon.cpp +++ b/src/opts/SkBlitRow_opts_arm_neon.cpp @@ -1730,20 +1730,3 @@ const SkBlitRow::Proc32 sk_blitrow_platform_32_procs_arm_neon[] = { NULL #endif }; - -#include "Sk4px.h" - -void sk_blitrow_color32_arm_neon(SkPMColor* dst, const SkPMColor* src, int count, SkPMColor color) { - // Until it becomes a little more reasonable to assume we'll be built with NEON, - // we copy our Sk4px implementation of SkBlitRow::Color32 here so it picks up NEON at runtime. - unsigned invA = 255 - SkGetPackedA32(color); - invA += invA >> 7; - SkASSERT(invA < 256); // Our caller has already handled the alpha == 0 case. - - Sk16h colorHighAndRound = Sk4px(color).widenHi() + Sk16h(128); - Sk16b invA_16x(invA); - - Sk4px::MapSrc(count, dst, src, [&](const Sk4px& src4) -> Sk4px { - return src4.mulWiden(invA_16x).addNarrowHi(colorHighAndRound); - }); -} diff --git a/src/opts/SkBlitRow_opts_arm_neon.h b/src/opts/SkBlitRow_opts_arm_neon.h index fb3d2e0a7b..159a466c98 100644 --- a/src/opts/SkBlitRow_opts_arm_neon.h +++ b/src/opts/SkBlitRow_opts_arm_neon.h @@ -13,6 +13,4 @@ extern const SkBlitRow::Proc16 sk_blitrow_platform_565_procs_arm_neon[]; extern const SkBlitRow::ColorProc16 sk_blitrow_platform_565_colorprocs_arm_neon[]; extern const SkBlitRow::Proc32 sk_blitrow_platform_32_procs_arm_neon[]; -extern void sk_blitrow_color32_arm_neon(SkPMColor[], const SkPMColor[], int, SkPMColor); - #endif