Optimize 9patch rendering.
This change detects empty quads in 9patches and removes them from
the mesh to avoid unnecessary blending.
Change-Id: I4500566fb4cb6845d64dcb59b522c0be7a0ec704
diff --git a/libs/hwui/PathCache.h b/libs/hwui/PathCache.h
index 596dfab..0c74261 100644
--- a/libs/hwui/PathCache.h
+++ b/libs/hwui/PathCache.h
@@ -22,6 +22,7 @@
#include <SkPath.h>
#include "Texture.h"
+#include "utils/Compare.h"
#include "utils/GenerationCache.h"
namespace android {
@@ -63,7 +64,18 @@
float strokeWidth;
bool operator<(const PathCacheEntry& rhs) const {
- return memcmp(this, &rhs, sizeof(PathCacheEntry)) < 0;
+ compareI(path) {
+ compareI(join) {
+ compareI(cap) {
+ compareI(style) {
+ compare(miter) {
+ compare(strokeWidth) return false;
+ }
+ }
+ }
+ }
+ }
+ return false;
}
}; // struct PathCacheEntry