aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core
diff options
context:
space:
mode:
authorGravatar digit@google.com <digit@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-08-06 14:53:32 +0000
committerGravatar digit@google.com <digit@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-08-06 14:53:32 +0000
commit157d94465a47a57e30e5cf49cd57dccd903e27e2 (patch)
treeb8a4f2bd2c2b03a88865a2c13e58173bfe2f6eba /include/core
parentb932407520663c3b636fb6e6027dc53732a115fb (diff)
rm: Introduce SK_ARM_NEON_WRAP handy wrapper macro.
It is used to simplify arm/neon dispatch logic code. Review URL: https://codereview.appspot.com/6458060 git-svn-id: http://skia.googlecode.com/svn/trunk@4958 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include/core')
-rw-r--r--include/core/SkPreConfig.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/core/SkPreConfig.h b/include/core/SkPreConfig.h
index bbf0124117..55b1abf3bc 100644
--- a/include/core/SkPreConfig.h
+++ b/include/core/SkPreConfig.h
@@ -173,5 +173,21 @@
#define SK_API
#endif
+//////////////////////////////////////////////////////////////////////
+
+/**
+ * Use SK_PURE_FUNC as an attribute to indicate that a function's
+ * return value only depends on the value of its parameters. This
+ * can help the compiler optimize out successive calls.
+ *
+ * Usage:
+ * void function(int params) SK_PURE_FUNC;
+ */
+#if defined(__GNUC__)
+# define SK_PURE_FUNC __attribute__((pure))
+#else
+# define SK_PURE_FUNC /* nothing */
+#endif
+
#endif