 |
Flutter Impeller
|
|
Go to the documentation of this file.
36 const Entity& entity)
const {
42 if (geometry ==
nullptr) {
59 auto geometry_result =
60 GetGeometry()->GetPositionBuffer(renderer, entity, pass);
63 if (geometry_result.prevent_overdraw) {
68 options.primitive_type = geometry_result.type;
70 cmd.
BindVertices(std::move(geometry_result.vertex_buffer));
72 VS::FrameInfo frame_info;
73 frame_info.mvp = capture.AddMatrix(
"Transform", geometry_result.transform);
74 frame_info.color = capture.AddColor(
"Color",
GetColor()).Premultiply();
81 if (geometry_result.prevent_overdraw) {
84 return restore.Render(renderer, entity, pass);
91 auto contents = std::make_unique<SolidColorContents>();
93 contents->SetColor(color);
99 ISize target_size)
const {
103 : std::optional<Color>();
108 color_ = color_filter_proc(color_);
Scalar GetOpacityFactor() const
Get the opacity factor for this color source.
An object used to specify work to the GPU along with references to resources the GPU will used when d...
#define DEBUG_COMMAND_INFO(obj, arg)
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.
@ kEqual
Comparison test passes if new_value == current_value.
bool IsSolidColor() const override
@ kIncrementClamp
Increment the current stencil value by 1. Clamp it to the maximum.
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
ContentContextOptions OptionsFromPassAndEntity(const RenderPass &pass, const Entity &entity)
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
bool BindVertices(VertexBuffer buffer)
Specify the vertex and index buffer to use for this command.
std::shared_ptr< Pipeline< PipelineDescriptor > > GetSolidFillPipeline(ContentContextOptions opts) const
static std::shared_ptr< Geometry > MakeFillPath(Path path, std::optional< Rect > inner_rect=std::nullopt)
Render passes encode render commands directed as one specific render target into an underlying comman...
uint32_t GetClipDepth() const
uint32_t stencil_reference
constexpr static TRect MakeSize(const TSize< U > &size)
void SetColor(Color color)
BufferView EmplaceUniform(const UniformType &uniform)
Emplace uniform data onto the host buffer. Ensure that backend specific uniform alignment requirement...
Capture CreateChild(std::string_view label)
std::shared_ptr< Pipeline< PipelineDescriptor > > pipeline
bool Render(const ContentContext &renderer, const Entity &entity, RenderPass &pass) const override
constexpr bool IsOpaque() const
VertexShader_ VertexShader
bool AddCommand(Command &&command)
Record a command for subsequent encoding to the underlying command buffer. No work is encoded into th...
static std::unique_ptr< SolidColorContents > Make(Path path, Color color)
HostBuffer & GetTransientsBuffer()
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 ...