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

Commit c9216d33 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Provide proper transform to mask canvas" into sc-dev

parents 7ae30966 9238f59d
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -46,9 +46,16 @@ void StretchMask::draw(GrRecordingContext* context,

    if (mIsDirty) {
        SkCanvas* maskCanvas = mMaskSurface->getCanvas();
        // Make sure to apply target transformation to the mask canvas
        // to ensure the replayed drawing commands generate the same result
        auto previousMatrix = displayList->mParentMatrix;
        displayList->mParentMatrix = maskCanvas->getTotalMatrix();
        maskCanvas->save();
        maskCanvas->drawColor(0, SkBlendMode::kClear);
        TransformCanvas transformCanvas(maskCanvas, SkBlendMode::kSrcOver);
        displayList->draw(&transformCanvas);
        maskCanvas->restore();
        displayList->mParentMatrix = previousMatrix;
    }

    sk_sp<SkImage> maskImage = mMaskSurface->makeImageSnapshot();