summaryrefslogtreecommitdiffstats
path: root/libs/hwui/utils
diff options
context:
space:
mode:
authorChris Craik <ccraik@google.com>2014-06-10 17:22:31 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-06-10 17:22:31 +0000
commit1e5cf9aced40e6e14262e542d0ed0e24cda877a0 (patch)
tree1b42070defc0a41277e27ae37c92748dec18fc99 /libs/hwui/utils
parentf1d758867aa878fb956af7c66bd2d3122adf72a0 (diff)
parent9a9d1d5ad2591f04881a401da0ad89a95eeddd00 (diff)
downloadframeworks_base-1e5cf9aced40e6e14262e542d0ed0e24cda877a0.zip
frameworks_base-1e5cf9aced40e6e14262e542d0ed0e24cda877a0.tar.gz
frameworks_base-1e5cf9aced40e6e14262e542d0ed0e24cda877a0.tar.bz2
am b1c76a1a: Merge "Tessellate on worker threads" into lmp-preview-dev
* commit 'b1c76a1abcfb2f33e12fef37ec71d20724863b5e': Tessellate on worker threads
Diffstat (limited to 'libs/hwui/utils')
-rw-r--r--libs/hwui/utils/Macros.h7
-rw-r--r--libs/hwui/utils/MathUtils.h4
2 files changed, 11 insertions, 0 deletions
diff --git a/libs/hwui/utils/Macros.h b/libs/hwui/utils/Macros.h
index 14a3ec0..5b7c87c 100644
--- a/libs/hwui/utils/Macros.h
+++ b/libs/hwui/utils/Macros.h
@@ -21,5 +21,12 @@
Type(const Type&); \
void operator=(const Type&)
+#define DESCRIPTION_TYPE(Type) \
+ int compare(const Type& rhs) const { return memcmp(this, &rhs, sizeof(Type));} \
+ bool operator==(const Type& other) const { return compare(other) == 0; } \
+ bool operator!=(const Type& other) const { return compare(other) != 0; } \
+ friend inline int strictly_order_type(const Type& lhs, const Type& rhs) { return lhs.compare(rhs) < 0; } \
+ friend inline int compare_type(const Type& lhs, const Type& rhs) { return lhs.compare(rhs); } \
+ friend inline hash_t hash_type(const Type& entry) { return entry.hash(); }
#endif /* MACROS_H */
diff --git a/libs/hwui/utils/MathUtils.h b/libs/hwui/utils/MathUtils.h
index 997acde2..65f1663 100644
--- a/libs/hwui/utils/MathUtils.h
+++ b/libs/hwui/utils/MathUtils.h
@@ -38,6 +38,10 @@ public:
return isZero(valueA - valueB);
}
+ inline static int max(int a, int b) {
+ return a > b ? a : b;
+ }
+
inline static int min(int a, int b) {
return a < b ? a : b;
}