 |
Flutter Impeller
|
|
Go to the documentation of this file.
36 const Entity& entity)
const {
41 const std::shared_ptr<Geometry>& geometry =
GetGeometry();
42 if (geometry ==
nullptr) {
54 VS::FrameInfo frame_info;
55 frame_info.color = capture.AddColor(
"Color",
GetColor()).Premultiply();
61 return ColorSourceContents::DrawGeometry<VS>(
62 renderer, entity, pass, pipeline_callback, frame_info,
71 auto contents = std::make_unique<SolidColorContents>();
73 contents->SetColor(color);
79 ISize target_size)
const {
83 : std::optional<Color>();
88 color_ = color_filter_proc(color_);
static std::unique_ptr< SolidColorContents > Make(const Path &path, Color color)
std::function< std::shared_ptr< Pipeline< PipelineDescriptor > >(ContentContextOptions)> PipelineBuilderCallback
Scalar GetOpacityFactor() const
Get the opacity factor for this color source.
bool IsOpaque() const override
Whether this Contents only emits opaque source colors from the fragment stage. This value does not ac...
Capture & GetCapture() const
const Matrix & GetTransform() const
Get the global transform matrix for this Entity.
bool IsSolidColor() const override
std::optional< Rect > GetCoverage(const Entity &entity) const override
Get the area of the render pass that will be affected when this contents is rendered.
const std::shared_ptr< Geometry > & GetGeometry() const
Get the geometry that this contents will use to render.
~SolidColorContents() override
virtual void SetCommandLabel(std::string_view label)
The debugging label to use for the command.
static std::shared_ptr< Geometry > MakeFillPath(const Path &path, std::optional< Rect > inner_rect=std::nullopt)
bool ApplyColorFilter(const ColorFilterProc &color_filter_proc) override
If possible, applies a color filter to this contents inputs on the CPU.
Paths are lightweight objects that describe a collection of linear, quadratic, or cubic segments....
std::function< Color(Color)> ColorFilterProc
constexpr Color WithAlpha(Scalar new_alpha) const
std::shared_ptr< Pipeline< PipelineDescriptor > > GetSolidFillPipeline(ContentContextOptions opts) const
Render passes encode render commands directed as one specific render target into an underlying comman...
constexpr static TRect MakeSize(const TSize< U > &size)
void SetColor(Color color)
Capture CreateChild(std::string_view label)
bool Render(const ContentContext &renderer, const Entity &entity, RenderPass &pass) const override
constexpr bool IsOpaque() const
VertexShader_ VertexShader
std::optional< Color > AsBackgroundColor(const Entity &entity, ISize target_size) const override
Returns a color if this Contents will flood the given target_size with a color. This output color is ...