summaryrefslogtreecommitdiff
path: root/libs/hwui/Matrix.cpp
diff options
context:
space:
mode:
authorChris Craik <ccraik@google.com>2016-03-09 16:03:21 -0800
committerChris Craik <ccraik@google.com>2016-03-09 16:14:35 -0800
commit034a10bf216cdef251928edf72d93668d81515f8 (patch)
tree792bdea747fb449853488748c51fe0d1db1e4d76 /libs/hwui/Matrix.cpp
parenta521c4a9fae31a1d51e80b2312c7e2a0b03908a9 (diff)
Partial revert of 261725fdb2962271c222a049fcdf57bbdc8363c7
Bug:27534946 Mapping empty rects still must be done to get correct positions for line/point rects describing strokable bounds. Change-Id: I2f9efe543e58eb438b755276585491c1256d6719
Diffstat (limited to 'libs/hwui/Matrix.cpp')
-rw-r--r--libs/hwui/Matrix.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/libs/hwui/Matrix.cpp b/libs/hwui/Matrix.cpp
index deab95690d0e..709156c4098b 100644
--- a/libs/hwui/Matrix.cpp
+++ b/libs/hwui/Matrix.cpp
@@ -437,8 +437,16 @@ void Matrix4::mapPoint(float& x, float& y) const {
y = dy * dz;
}
+/**
+ * Set the contents of the rect to be the bounding rect around each of the corners, mapped by the
+ * matrix.
+ *
+ * NOTE: an empty rect to an arbitrary matrix isn't guaranteed to have an empty output, since that's
+ * important for conservative bounds estimation (e.g. rotate45Matrix.mapRect of Rect(0, 10) should
+ * result in non-empty.
+ */
void Matrix4::mapRect(Rect& r) const {
- if (isIdentity() || r.isEmpty()) return;
+ if (isIdentity()) return;
if (isSimple()) {
MUL_ADD_STORE(r.left, data[kScaleX], data[kTranslateX]);