diff options
author | Chris Craik <ccraik@google.com> | 2014-06-02 16:27:04 -0700 |
---|---|---|
committer | Chris Craik <ccraik@google.com> | 2014-06-10 01:53:17 +0000 |
commit | 05f3d6e5111fd08df5cd9aae2c3d28399dc0e7f5 (patch) | |
tree | 14df3cad82b02a886b8e3a04fd4ec249e1d403e4 /libs/hwui/utils | |
parent | faecafce62ca39a7693669f7c9eabf2d71c633cf (diff) | |
download | frameworks_base-05f3d6e5111fd08df5cd9aae2c3d28399dc0e7f5.zip frameworks_base-05f3d6e5111fd08df5cd9aae2c3d28399dc0e7f5.tar.gz frameworks_base-05f3d6e5111fd08df5cd9aae2c3d28399dc0e7f5.tar.bz2 |
Tessellate on worker threads
Tessellate and cache (where possible) shadow and round rect
tessellation tasks.
Change-Id: I2cfda8e11d83d51ea74af871235cf26e8f831d40
Diffstat (limited to 'libs/hwui/utils')
-rw-r--r-- | libs/hwui/utils/Macros.h | 7 | ||||
-rw-r--r-- | libs/hwui/utils/MathUtils.h | 4 |
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; } |