From 996fe656340ede058a6f0e6b18f9ec525ddb4e27 Mon Sep 17 00:00:00 2001 From: Chris Craik Date: Fri, 20 Sep 2013 17:13:18 -0700 Subject: Correct bitmap merging logic bug:10863163 This fixes two issues The check for pure translation was incorrect. It was fixed and renamed for clarity. Certain matrix paths weren't setting kTypePositiveScale. For simplicity (and because positive scale is simple to check) removed flag in favor of dynamic checking. Change-Id: Ic5ce235653ef49a68b8b242bd89fc2e95874ecc9 --- libs/hwui/DisplayListOp.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'libs/hwui/DisplayListOp.h') diff --git a/libs/hwui/DisplayListOp.h b/libs/hwui/DisplayListOp.h index b052461..326805a 100644 --- a/libs/hwui/DisplayListOp.h +++ b/libs/hwui/DisplayListOp.h @@ -772,7 +772,7 @@ public: TextureVertex* vertex = &vertices[0]; const bool hasLayer = renderer.hasLayer(); - bool transformed = false; + bool pureTranslate = true; // TODO: manually handle rect clip for bitmaps by adjusting texCoords per op, // and allowing them to be merged in getBatchId() @@ -782,7 +782,7 @@ public: // When we reach multiDraw(), the matrix can be either // pureTranslate or simple (translate and/or scale). // If the matrix is not pureTranslate, then we have a scale - if (state.mMatrix.isPureTranslate()) transformed = true; + pureTranslate &= state.mMatrix.isPureTranslate(); Rect texCoords(0, 0, 1, 1); ((DrawBitmapOp*) ops[i].op)->mUvMapper.map(texCoords); @@ -801,7 +801,7 @@ public: } return renderer.drawBitmaps(mBitmap, mEntry, ops.size(), &vertices[0], - transformed, bounds, mPaint); + pureTranslate, bounds, mPaint); } virtual void output(int level, uint32_t logFlags) const { -- cgit v1.1