diff options
author | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-05-27 12:45:42 +0000 |
---|---|---|
committer | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-05-27 12:45:42 +0000 |
commit | b0c769abe1e1a0e4aa6a8008d7f3c113bc3e7cf7 (patch) | |
tree | 3bc6cc3e7f1ee6c63c141cba6860998a792f1696 /src | |
parent | 53c63a5136a6871996616d809967de1dfb54a8b5 (diff) |
sk_memcpy32 should fall back on libc memcpy.
Writing it out ourselves was a ~2x slowdown on ARM.
BUG=skia:
R=henrik.smiding@intel.com, mtklein@google.com
Author: mtklein@chromium.org
Review URL: https://codereview.chromium.org/292663013
git-svn-id: http://skia.googlecode.com/svn/trunk@14886 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src')
-rw-r--r-- | src/core/SkUtils.cpp | 28 |
1 files changed, 1 insertions, 27 deletions
diff --git a/src/core/SkUtils.cpp b/src/core/SkUtils.cpp index c65947dfe9..ca18e0cb2d 100644 --- a/src/core/SkUtils.cpp +++ b/src/core/SkUtils.cpp @@ -34,18 +34,6 @@ *(dst)++ = value; *(dst)++ = value; \ *(dst)++ = value; *(dst)++ = value; \ } while (0) - -#define copy_16_longs(dst, src) \ - do { \ - *(dst)++ = *(src)++; *(dst)++ = *(src)++; \ - *(dst)++ = *(src)++; *(dst)++ = *(src)++; \ - *(dst)++ = *(src)++; *(dst)++ = *(src)++; \ - *(dst)++ = *(src)++; *(dst)++ = *(src)++; \ - *(dst)++ = *(src)++; *(dst)++ = *(src)++; \ - *(dst)++ = *(src)++; *(dst)++ = *(src)++; \ - *(dst)++ = *(src)++; *(dst)++ = *(src)++; \ - *(dst)++ = *(src)++; *(dst)++ = *(src)++; \ - } while (0) #endif /////////////////////////////////////////////////////////////////////////////// @@ -122,21 +110,7 @@ static void sk_memset32_portable(uint32_t dst[], uint32_t value, int count) { } static void sk_memcpy32_portable(uint32_t dst[], const uint32_t src[], int count) { - SkASSERT(dst != NULL && count >= 0); - - int sixteenlongs = count >> 4; - if (sixteenlongs) { - do { - copy_16_longs(dst, src); - } while (--sixteenlongs != 0); - count &= 15; - } - - if (count) { - do { - *dst++ = *src++; - } while (--count != 0); - } + memcpy(dst, src, count * sizeof(uint32_t)); } static void choose_memset16(SkMemset16Proc* proc) { |