| // Copyright 2013 The Flutter Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| #include "impeller/entity/contents/filters/matrix_filter_contents.h" |
| |
| namespace impeller { |
| |
| MatrixFilterContents::MatrixFilterContents() = default; |
| |
| MatrixFilterContents::~MatrixFilterContents() = default; |
| |
| void MatrixFilterContents::SetMatrix(Matrix matrix) { |
| matrix_ = matrix; |
| } |
| |
| Matrix MatrixFilterContents::GetLocalTransform( |
| const Matrix& parent_transform) const { |
| return parent_transform.Invert() * matrix_ * parent_transform; |
| } |
| |
| std::optional<Snapshot> MatrixFilterContents::RenderFilter( |
| const FilterInput::Vector& inputs, |
| const ContentContext& renderer, |
| const Entity& entity, |
| const Matrix& effect_transform, |
| const Rect& coverage) const { |
| return inputs[0]->GetSnapshot(renderer, entity); |
| } |
| |
| } // namespace impeller |