diff options
| author | 2016-01-14 01:30:02 +0000 | |
|---|---|---|
| committer | 2016-01-14 01:30:02 +0000 | |
| commit | 2300b83462515f682364c580ff64a140296bfbf3 (patch) | |
| tree | 904981a7396e30d7d747ee74d127b720e8034e76 | |
| parent | fdbdb9f9c6cd2f2cd1a494fb9b295dcaf4fd101c (diff) | |
| parent | e410a357f50651065a0cb39d8de809c861b56f75 (diff) | |
Merge "Properly handle the negative scaling factor of canvas in VectorDrawable"
| -rw-r--r-- | libs/hwui/VectorDrawable.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libs/hwui/VectorDrawable.cpp b/libs/hwui/VectorDrawable.cpp index 56cb10476118..793df92dae45 100644 --- a/libs/hwui/VectorDrawable.cpp +++ b/libs/hwui/VectorDrawable.cpp @@ -407,8 +407,9 @@ void Tree::draw(Canvas* outCanvas, SkColorFilter* colorFilter, float canvasScaleY = 1.0f; if (mCanvasMatrix.getSkewX() == 0 && mCanvasMatrix.getSkewY() == 0) { // Only use the scale value when there's no skew or rotation in the canvas matrix. - canvasScaleX = mCanvasMatrix.getScaleX(); - canvasScaleY = mCanvasMatrix.getScaleY(); + // TODO: Add a cts test for drawing VD on a canvas with negative scaling factors. + canvasScaleX = fabs(mCanvasMatrix.getScaleX()); + canvasScaleY = fabs(mCanvasMatrix.getScaleY()); } int scaledWidth = (int) (mBounds.width() * canvasScaleX); int scaledHeight = (int) (mBounds.height() * canvasScaleY); |