summaryrefslogtreecommitdiffstats
path: root/libs/hwui
diff options
context:
space:
mode:
authorChris Craik <ccraik@google.com>2015-08-18 14:52:52 -0700
committerChris Craik <ccraik@google.com>2015-08-18 14:53:47 -0700
commite688bf720334f58e0003b4c75b53cc7618adf43f (patch)
treeb0f0966e938947efa69e5669ca2e7614b5eed107 /libs/hwui
parentf2cb6f7e3ea143ba4acace0821c9d49e363da7eb (diff)
downloadframeworks_base-e688bf720334f58e0003b4c75b53cc7618adf43f.zip
frameworks_base-e688bf720334f58e0003b4c75b53cc7618adf43f.tar.gz
frameworks_base-e688bf720334f58e0003b4c75b53cc7618adf43f.tar.bz2
Constrain drawBitmap matrix-to-rect optimization
bug:22962165 Optimization is not valid if matrix would flip image. Change-Id: Ieee42390517bd3466b7d94596f0fbbe192ab757e
Diffstat (limited to 'libs/hwui')
-rw-r--r--libs/hwui/DisplayListCanvas.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/libs/hwui/DisplayListCanvas.cpp b/libs/hwui/DisplayListCanvas.cpp
index aeb1a3d..2dd5278 100644
--- a/libs/hwui/DisplayListCanvas.cpp
+++ b/libs/hwui/DisplayListCanvas.cpp
@@ -255,7 +255,9 @@ void DisplayListCanvas::drawBitmap(const SkBitmap& bitmap, const SkMatrix& matri
const SkPaint* paint) {
if (matrix.isIdentity()) {
drawBitmap(&bitmap, paint);
- } else if (!(matrix.getType() & ~(SkMatrix::kScale_Mask | SkMatrix::kTranslate_Mask))) {
+ } else if (!(matrix.getType() & ~(SkMatrix::kScale_Mask | SkMatrix::kTranslate_Mask))
+ && MathUtils::isPositive(matrix.getScaleX())
+ && MathUtils::isPositive(matrix.getScaleY())) {
// SkMatrix::isScaleTranslate() not available in L
SkRect src;
SkRect dst;