Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
paint_pass_delegate.h
Go to the documentation of this file.
1// Copyright 2013 The Flutter Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef FLUTTER_IMPELLER_AIKS_PAINT_PASS_DELEGATE_H_
6#define FLUTTER_IMPELLER_AIKS_PAINT_PASS_DELEGATE_H_
7
8#include <optional>
9
10#include "flutter/fml/macros.h"
11#include "impeller/aiks/paint.h"
13
14namespace impeller {
15
17 public:
19
20 // |EntityPassDelgate|
22
23 // |EntityPassDelgate|
24 bool CanElide() override;
25
26 // |EntityPassDelgate|
27 bool CanCollapseIntoParentPass(EntityPass* entity_pass) override;
28
29 // |EntityPassDelgate|
30 std::shared_ptr<Contents> CreateContentsForSubpassTarget(
31 std::shared_ptr<Texture> target,
32 const Matrix& effect_transform) override;
33
34 // |EntityPassDelgate|
35 std::shared_ptr<FilterContents> WithImageFilter(
36 const FilterInput::Variant& input,
37 const Matrix& effect_transform) const override;
38
39 private:
40 const Paint paint_;
41
42 PaintPassDelegate(const PaintPassDelegate&) = delete;
43
44 PaintPassDelegate& operator=(const PaintPassDelegate&) = delete;
45};
46
47/// A delegate that attempts to forward opacity from a save layer to
48/// child contents.
49///
50/// Currently this has a hardcoded limit of 3 entities in a pass, and
51/// cannot forward to child subpass delegates.
53 public:
55
56 // |EntityPassDelgate|
58
59 // |EntityPassDelgate|
60 bool CanElide() override;
61
62 // |EntityPassDelgate|
63 bool CanCollapseIntoParentPass(EntityPass* entity_pass) override;
64
65 // |EntityPassDelgate|
66 std::shared_ptr<Contents> CreateContentsForSubpassTarget(
67 std::shared_ptr<Texture> target,
68 const Matrix& effect_transform) override;
69
70 // |EntityPassDelgate|
71 std::shared_ptr<FilterContents> WithImageFilter(
72 const FilterInput::Variant& input,
73 const Matrix& effect_transform) const override;
74
75 private:
76 const Paint paint_;
77
79
81 delete;
82};
83
84} // namespace impeller
85
86#endif // FLUTTER_IMPELLER_AIKS_PAINT_PASS_DELEGATE_H_
std::variant< std::shared_ptr< FilterContents >, std::shared_ptr< Contents >, std::shared_ptr< Texture >, Rect > Variant
std::shared_ptr< Contents > CreateContentsForSubpassTarget(std::shared_ptr< Texture > target, const Matrix &effect_transform) override
bool CanCollapseIntoParentPass(EntityPass *entity_pass) override
Whether or not this entity pass can be collapsed into the parent. If true, this method may modify the...
std::shared_ptr< FilterContents > WithImageFilter(const FilterInput::Variant &input, const Matrix &effect_transform) const override
bool CanCollapseIntoParentPass(EntityPass *entity_pass) override
Whether or not this entity pass can be collapsed into the parent. If true, this method may modify the...
std::shared_ptr< FilterContents > WithImageFilter(const FilterInput::Variant &input, const Matrix &effect_transform) const override
std::shared_ptr< Contents > CreateContentsForSubpassTarget(std::shared_ptr< Texture > target, const Matrix &effect_transform) override
const Paint & paint
uint32_t * target
A 4x4 matrix using column-major storage.
Definition matrix.h:37