Merged op dispatch in OpReorderer
bug:22480459
Also switches std::functions to function pointers on OpReorderer, and
switches AssetAtlas' entry getter methods to using pixelRef pointers,
so it's clear they're the keys.
Change-Id: I3040ce5ff4e178a8364e0fd7ab0876ada7d4de05
diff --git a/libs/hwui/Rect.h b/libs/hwui/Rect.h
index 472aad7..30c925c 100644
--- a/libs/hwui/Rect.h
+++ b/libs/hwui/Rect.h
@@ -253,7 +253,18 @@
bottom = ceilf(bottom);
}
- void expandToCoverVertex(float x, float y) {
+ /*
+ * Similar to unionWith, except this makes the assumption that both rects are non-empty
+ * to avoid both emptiness checks.
+ */
+ void expandToCover(const Rect& other) {
+ left = std::min(left, other.left);
+ top = std::min(top, other.top);
+ right = std::max(right, other.right);
+ bottom = std::max(bottom, other.bottom);
+ }
+
+ void expandToCover(float x, float y) {
left = std::min(left, x);
top = std::min(top, y);
right = std::max(right, x);