summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Stan Iliev <stani@google.com> 2018-07-18 16:54:22 -0700
committer android-build-merger <android-build-merger@google.com> 2018-07-18 16:54:22 -0700
commit0678660c8d425532ba06b0320343c05bc70a78c7 (patch)
treee373d90199067f654f2d19021354c67e9af7eaa3
parentc9756c9193bbbec8bc3a22536f6967c56c833135 (diff)
parentf5d4ea6132065a99927a47faaab4dd2fcedea6dd (diff)
Merge "Fix TextureView.getBitmap with scale layer transform" into pi-dev
am: f5d4ea6132 Change-Id: I76c8480c0ce5583ce75a91d665862032415c54d8
-rw-r--r--libs/hwui/pipeline/skia/LayerDrawable.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/libs/hwui/pipeline/skia/LayerDrawable.cpp b/libs/hwui/pipeline/skia/LayerDrawable.cpp
index 4f16ddb9881b..6e7511da07ff 100644
--- a/libs/hwui/pipeline/skia/LayerDrawable.cpp
+++ b/libs/hwui/pipeline/skia/LayerDrawable.cpp
@@ -82,7 +82,14 @@ bool LayerDrawable::DrawLayer(GrContext* context, SkCanvas* canvas, Layer* layer
textureMatrix = textureMatrixInv;
}
- SkMatrix matrix = SkMatrix::Concat(layerTransform, textureMatrix);
+ SkMatrix matrix;
+ if (dstRect) {
+ // Destination rectangle is set only when we are trying to read back the content
+ // of the layer. In this case we don't want to apply layer transform.
+ matrix = textureMatrix;
+ } else {
+ matrix = SkMatrix::Concat(layerTransform, textureMatrix);
+ }
SkPaint paint;
paint.setAlpha(layer->getAlpha());