 |
Flutter Impeller
|
|
Go to the documentation of this file.
36 const Entity& entity)
const {
42 if (geometry ==
nullptr) {
55 VS::FrameInfo frame_info;
56 FS::FragInfo frag_info;
64 return ColorSourceContents::DrawGeometry<VS>(
65 renderer, entity, pass, pipeline_callback, frame_info,
67 FS::BindFragInfo(pass, host_buffer.EmplaceUniform(frag_info));
75 ISize target_size)
const {
79 : std::optional<Color>();
84 color_ = color_filter_proc(color_);
FragmentShader_ FragmentShader
std::function< std::shared_ptr< Pipeline< PipelineDescriptor > >(ContentContextOptions)> PipelineBuilderCallback
Scalar GetOpacityFactor() const
Get the opacity factor for this color source.
virtual Scalar ComputeAlphaCoverage(const Matrix &transform) const
const Matrix & GetTransform() const
Get the global transform matrix for this Entity.
virtual std::optional< Rect > GetCoverage(const Matrix &transform) const =0
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.
~SolidColorContents() override
virtual bool CoversArea(const Matrix &transform, const Rect &rect) const
Determines if this geometry, transformed by the given transform, will completely cover all surface ar...
virtual void SetCommandLabel(std::string_view label)
The debugging label to use for the command.
bool ApplyColorFilter(const ColorFilterProc &color_filter_proc) override
If possible, applies a color filter to this contents inputs on the CPU.
std::function< Color(Color)> ColorFilterProc
constexpr Color WithAlpha(Scalar new_alpha) const
VertexShader_ VertexShader
std::shared_ptr< Pipeline< PipelineDescriptor > > GetSolidFillPipeline(ContentContextOptions opts) const
const Geometry * GetGeometry() const
Get the geometry that this contents will use to render.
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)
bool AppliesAlphaForStrokeCoverage(const Matrix &transform) const
Whether the entity should be treated as non-opaque due to stroke geometry requiring alpha for coverag...
bool Render(const ContentContext &renderer, const Entity &entity, RenderPass &pass) const override
constexpr bool IsOpaque() const
bool IsOpaque(const Matrix &transform) const override
Whether this Contents only emits opaque source colors from the fragment stage. This value does not ac...
constexpr Color Premultiply() const
A 4x4 matrix using column-major storage.
HostBuffer & GetTransientsBuffer() const
Retrieve the currnent host buffer for transient storage.
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 ...