#include "flutter/flow/ohos_layers/transform_layer.h"
#include "flutter/flow/ohos_layers/paint_context.h"
namespace flutter::OHOS {
void TransformLayer::Prepare(const SkMatrix& matrix)
{
SkMatrix childMatrix;
childMatrix.setConcat(matrix, transform_);
SkRect childPaintBounds = SkRect::MakeEmpty();
PrepareChildren(childMatrix, childPaintBounds);
transform_.mapRect(&childPaintBounds);
SetPaintBounds(childPaintBounds);
}
void TransformLayer::Paint(const PaintContext& paintContext) const
{
SkAutoCanvasRestore save(paintContext.skCanvas, true);
paintContext.skCanvas->concat(transform_);
PaintChildren(paintContext);
}
}