summaryrefslogtreecommitdiffstats
path: root/libs/hwui/Matrix.cpp
diff options
context:
space:
mode:
authorRomain Guy <romainguy@google.com>2010-10-12 15:59:26 -0700
committerRomain Guy <romainguy@google.com>2010-10-12 15:59:26 -0700
commit4bb942083a0d4db746adf95349108dd8ef842e32 (patch)
tree7707bc9551f3db4ad0561c30c73293e4a0edfbf2 /libs/hwui/Matrix.cpp
parent5a3b8e698e276839e502dcf41894b56ad59695c3 (diff)
downloadframeworks_base-4bb942083a0d4db746adf95349108dd8ef842e32.zip
frameworks_base-4bb942083a0d4db746adf95349108dd8ef842e32.tar.gz
frameworks_base-4bb942083a0d4db746adf95349108dd8ef842e32.tar.bz2
Optimize 9patch rendering.
This change detects empty quads in 9patches and removes them from the mesh to avoid unnecessary blending. Change-Id: I4500566fb4cb6845d64dcb59b522c0be7a0ec704
Diffstat (limited to 'libs/hwui/Matrix.cpp')
-rw-r--r--libs/hwui/Matrix.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/libs/hwui/Matrix.cpp b/libs/hwui/Matrix.cpp
index 219fd5e..5502e66 100644
--- a/libs/hwui/Matrix.cpp
+++ b/libs/hwui/Matrix.cpp
@@ -24,6 +24,7 @@
#include <SkMatrix.h>
+#include "utils/Compare.h"
#include "Matrix.h"
namespace android {
@@ -53,9 +54,6 @@ void Matrix4::loadIdentity() {
mSimpleMatrix = true;
}
-#define EPSILON 0.00001f
-#define almost(u, v) (fabs((u) - (v)) < EPSILON)
-
bool Matrix4::changesBounds() {
return !(almost(data[0], 1.0f) && almost(data[1], 0.0f) && almost(data[2], 0.0f) &&
almost(data[4], 0.0f) && almost(data[5], 1.0f) && almost(data[6], 0.0f) &&