aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard Hansen <cyanogenmod@rhansen.org>2013-02-19 13:26:53 -0500
committerRichard Hansen <cyanogenmod@rhansen.org>2013-02-21 16:04:18 -0500
commitad673c1cb9dd151fd4e74380c4ba82c1fefb580b (patch)
tree4437b6c1ed352d51382f4938c8ddcfb4a0a8c8a5 /src
parentcb5701ecfa08563037c24cc7b8ed4bb2629ef70b (diff)
downloadexternal_skia-ad673c1cb9dd151fd4e74380c4ba82c1fefb580b.zip
external_skia-ad673c1cb9dd151fd4e74380c4ba82c1fefb580b.tar.gz
external_skia-ad673c1cb9dd151fd4e74380c4ba82c1fefb580b.tar.bz2
memcpy_76(): add support for non-ARM architectures
Before, memcpy_76() assumed ARM instruction set. Add preprocessor guards to use generic memcpy() if not on ARM. Change-Id: Id4d7335332f4086fa33641630f41810b2fe07031
Diffstat (limited to 'src')
-rw-r--r--src/core/SkPaint.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/core/SkPaint.cpp b/src/core/SkPaint.cpp
index a701ba5..d45bdba 100644
--- a/src/core/SkPaint.cpp
+++ b/src/core/SkPaint.cpp
@@ -150,7 +150,8 @@ SkPaint::SkPaint() {
extern "C" {
//Hard coded copy with size of 76 bytes. This will avoid the extra cost
//of size checking branching in generic memcpy code
- inline void memcpy_76(int* src, int* dst) {
+ inline void memcpy_76(int* dst, const int* src) {
+#if defined(__CPU_ARCH_ARM)
__asm__ volatile ("cpy r4, %1 \n"
"cpy r5, %0 \n"
"ldm r4!, {r0-r3} \n"
@@ -167,8 +168,12 @@ extern "C" {
:
: "r" (src), "r" (dst)
: "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r12");
+#else
+ memcpy(dst, src, 76);
+#endif
}
}
+
SkPaint::SkPaint(const SkPaint& src) {
//Note: need to update this when SkPaint struture/size is changed!
if(sizeof(src) == 76){