aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Kondik <shade@chemlab.org>2013-02-27 22:53:45 -0800
committerSteve Kondik <shade@chemlab.org>2013-02-27 22:53:45 -0800
commitf4be52e288aeff28b503885d34074b87d7ce5bce (patch)
tree85d03a6aeef87fd55c601aea32bac5e8d406c1e2
parenta8ce1a0f1e5d1bcfa4d1da94ae2e01f0f9203c32 (diff)
downloadexternal_skia-f4be52e288aeff28b503885d34074b87d7ce5bce.zip
external_skia-f4be52e288aeff28b503885d34074b87d7ce5bce.tar.gz
external_skia-f4be52e288aeff28b503885d34074b87d7ce5bce.tar.bz2
FIX: 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. Original patch had args to memcpy_76 backwards. Change-Id: Ib5375e9de28ab6c2b348731dcdf282d6f7a529c1
-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..d7d6cbd 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* src, const int* dst) {
+#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){