 |
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;
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_);
static std::unique_ptr< SolidColorContents > Make(const Path &path, Color 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...
Capture CreateChild(const std::string &label)
#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...
uint32_t GetStencilDepth() const
Capture & GetCapture() const
bool IsSolidColor() const override
std::optional< Rect > GetCoverage(const Entity &entity) const override
Get the screen space bounding rectangle that this contents affects.
const std::shared_ptr< Geometry > & GetGeometry() const
Get the geometry that this contents will use to render.
~SolidColorContents() override
const Matrix & GetTransformation() const
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
std::shared_ptr< Pipeline< PipelineDescriptor > > GetSolidFillPipeline(ContentContextOptions opts) const
@ kIncrementClamp
Increment the current stencil value by 1. Clamp it to the maximum.
Render passes encode render commands directed as one specific render target into an underlying comman...
uint32_t stencil_reference
constexpr static TRect MakeSize(const TSize< U > &size)
void SetColor(Color color)
static std::unique_ptr< Geometry > MakeFillPath(const Path &path, std::optional< Rect > inner_rect=std::nullopt)
BufferView EmplaceUniform(const UniformType &uniform)
Emplace uniform data onto the host buffer. Ensure that backend specific uniform alignment requirement...
@ kEqual
Comparison test passes if new_value == current_value.
bool BindVertices(const VertexBuffer &buffer)
Specify the vertex and index buffer to use for this command.
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...
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 ...