summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRomain Guy <romainguy@google.com>2011-06-09 18:52:38 -0700
committerRomain Guy <romainguy@google.com>2011-06-09 18:52:38 -0700
commit181d0a6ccedee03789919d53c46540a8df751896 (patch)
tree9a18b084e28573c7625b4f1db25fb12fd05f8f71
parent59a12cae208790dd202656f50a40a53ef49baeeb (diff)
downloadframeworks_base-181d0a6ccedee03789919d53c46540a8df751896.zip
frameworks_base-181d0a6ccedee03789919d53c46540a8df751896.tar.gz
frameworks_base-181d0a6ccedee03789919d53c46540a8df751896.tar.bz2
Don't apply AA to rects with no rotation/perspective.
Change-Id: I21138d4d0589cc28f1dcffb8b675cd81a9900e24
-rw-r--r--libs/hwui/Matrix.cpp4
-rw-r--r--libs/hwui/Matrix.h1
-rw-r--r--libs/hwui/OpenGLRenderer.cpp5
3 files changed, 7 insertions, 3 deletions
diff --git a/libs/hwui/Matrix.cpp b/libs/hwui/Matrix.cpp
index e7c0fe3..9fc5131 100644
--- a/libs/hwui/Matrix.cpp
+++ b/libs/hwui/Matrix.cpp
@@ -67,6 +67,10 @@ bool Matrix4::isPureTranslate() {
ALMOST_EQUAL(data[kScaleX], 1.0f) && ALMOST_EQUAL(data[kScaleY], 1.0f);
}
+bool Matrix4::isSimple() {
+ return mSimpleMatrix;
+}
+
void Matrix4::load(const float* v) {
memcpy(data, v, sizeof(data));
mSimpleMatrix = false;
diff --git a/libs/hwui/Matrix.h b/libs/hwui/Matrix.h
index 08f5d77..2fa6ab7 100644
--- a/libs/hwui/Matrix.h
+++ b/libs/hwui/Matrix.h
@@ -111,6 +111,7 @@ public:
}
bool isPureTranslate();
+ bool isSimple();
bool changesBounds();
diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp
index 8558054..6c9c0eb 100644
--- a/libs/hwui/OpenGLRenderer.cpp
+++ b/libs/hwui/OpenGLRenderer.cpp
@@ -1478,8 +1478,7 @@ void OpenGLRenderer::drawPatch(SkBitmap* bitmap, const int32_t* xDivs, const int
* within that boundary region and how far into the region it is.
*/
void OpenGLRenderer::drawAARect(float left, float top, float right, float bottom,
- int color, SkXfermode::Mode mode)
-{
+ int color, SkXfermode::Mode mode) {
float inverseScaleX = 1.0f;
float inverseScaleY = 1.0f;
// The quad that we use needs to account for scaling.
@@ -1935,7 +1934,7 @@ void OpenGLRenderer::drawRect(float left, float top, float right, float bottom,
}
int color = p->getColor();
- if (p->isAntiAlias()) {
+ if (p->isAntiAlias() && !mSnapshot->transform->isSimple()) {
drawAARect(left, top, right, bottom, color, mode);
} else {
drawColorRect(left, top, right, bottom, color, mode);