diff options
author | Chris Craik <ccraik@google.com> | 2015-06-22 14:51:18 -0700 |
---|---|---|
committer | Chris Craik <ccraik@google.com> | 2015-06-22 14:51:18 -0700 |
commit | 772687d24206e2fa2deebf0980a932573a624b17 (patch) | |
tree | 4d7441b8fad63cc6ea29c24a5cc51e276b5f3bcd /libs/hwui | |
parent | bcca4ac4fb4fa66f2e4196437998c08e4dbed1d3 (diff) | |
download | frameworks_base-772687d24206e2fa2deebf0980a932573a624b17.zip frameworks_base-772687d24206e2fa2deebf0980a932573a624b17.tar.gz frameworks_base-772687d24206e2fa2deebf0980a932573a624b17.tar.bz2 |
Avoid flushing DisplayListCanvas state for noop calls
bug:22006795
Change-Id: I2eceee69772b08f5319ea882be429a5b36860b7d
Diffstat (limited to 'libs/hwui')
-rw-r--r-- | libs/hwui/DisplayListCanvas.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libs/hwui/DisplayListCanvas.cpp b/libs/hwui/DisplayListCanvas.cpp index 843c412..02a4877 100644 --- a/libs/hwui/DisplayListCanvas.cpp +++ b/libs/hwui/DisplayListCanvas.cpp @@ -135,6 +135,8 @@ int DisplayListCanvas::saveLayer(float left, float top, float right, float botto } void DisplayListCanvas::translate(float dx, float dy) { + if (dx == 0.0f && dy == 0.0f) return; + mHasDeferredTranslate = true; mTranslateX += dx; mTranslateY += dy; @@ -143,11 +145,15 @@ void DisplayListCanvas::translate(float dx, float dy) { } void DisplayListCanvas::rotate(float degrees) { + if (degrees == 0.0f) return; + addStateOp(new (alloc()) RotateOp(degrees)); mState.rotate(degrees); } void DisplayListCanvas::scale(float sx, float sy) { + if (sx == 1.0f && sy == 1.0f) return; + addStateOp(new (alloc()) ScaleOp(sx, sy)); mState.scale(sx, sy); } |