summaryrefslogtreecommitdiff
path: root/libs/hwui/Matrix.cpp
diff options
context:
space:
mode:
authorRomain Guy <romainguy@google.com>2010-10-27 18:57:51 -0700
committerRomain Guy <romainguy@google.com>2010-11-02 16:17:23 -0700
commit5b3b35296e8b2c8d3f07d32bb645d5414db41a1d (patch)
treebad2ebdbfeb8a3a0be1591d5a357a8280df7d1d2 /libs/hwui/Matrix.cpp
parent2444ddb3d9b59ec45ba50858fcbff639e59b93b1 (diff)
Optimize FBO drawing with regions.
This optimization is currently disabled until Launcher is modified to take advantage of it. The optimization can be enabled by turning on RENDER_LAYERS_AS_REGIONS in the OpenGLRenderer.h file. Change-Id: I2fdf59d0f4dc690a3d7f712173ab8db3848b27b1
Diffstat (limited to 'libs/hwui/Matrix.cpp')
-rw-r--r--libs/hwui/Matrix.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/libs/hwui/Matrix.cpp b/libs/hwui/Matrix.cpp
index 83ea615d2263..7462d5bae208 100644
--- a/libs/hwui/Matrix.cpp
+++ b/libs/hwui/Matrix.cpp
@@ -271,6 +271,19 @@ void Matrix4::mapRect(Rect& r) const {
MUL_ADD_STORE(r.right, data[kScaleX], data[kTranslateX]);
MUL_ADD_STORE(r.top, data[kScaleY], data[kTranslateY]);
MUL_ADD_STORE(r.bottom, data[kScaleY], data[kTranslateY]);
+
+ if (r.left > r.right) {
+ float x = r.left;
+ r.left = r.right;
+ r.right = x;
+ }
+
+ if (r.top > r.bottom) {
+ float y = r.top;
+ r.top = r.bottom;
+ r.bottom = y;
+ }
+
return;
}