Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 421449a4 authored by Stan Iliev's avatar Stan Iliev Committed by Po-Chien Hsueh
Browse files

Fix TextureView.getBitmap with scale layer transform

Fix TextureView.getBitmap to capture content only from the layer.

Bug: 111401911
Test: A new test TextureViewTest.testTransformScale is passing
Change-Id: I2b9cee17fc48de7b12ed03d5b4f173ce5445dbfe
Merged-In: I2b9cee17fc48de7b12ed03d5b4f173ce5445dbfe
(cherry-picked from ff129aef)
(cherry picked from commit 9675537555913a6aa7c25a71a6b854a083e22ede)
parent c96760f4
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -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());