diff options
author | Chris Craik <ccraik@google.com> | 2015-12-03 12:16:56 -0800 |
---|---|---|
committer | Chris Craik <ccraik@google.com> | 2015-12-07 12:34:46 -0800 |
commit | 15c3f19a445b8df575911a16e8a6dba755a084b5 (patch) | |
tree | 5e3a71be6407e696ce6256c3825eb94632fbc541 /libs/hwui/Rect.h | |
parent | e920098f31860824ca714f10b2e72dbff5442184 (diff) |
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
Diffstat (limited to 'libs/hwui/Rect.h')
-rw-r--r-- | libs/hwui/Rect.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/libs/hwui/Rect.h b/libs/hwui/Rect.h index 472aad711432..30c925c8775b 100644 --- a/libs/hwui/Rect.h +++ b/libs/hwui/Rect.h @@ -253,7 +253,18 @@ public: 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); |