 |
Flutter Impeller
|
|
Go to the documentation of this file.
32 corner_radii_ = corner_radii;
48 const Entity& entity)
const {
49 if (!rect_.has_value()) {
55 return rect_->Expand(radius).TransformBounds(entity.
GetTransform());
61 if (!rect_.has_value()) {
76 auto blur_radius = PadForSigma(blur_sigma);
77 auto positive_rect = rect_->GetPositive();
79 auto left = -blur_radius;
80 auto top = -blur_radius;
81 auto right = positive_rect.GetWidth() + blur_radius;
82 auto bottom = positive_rect.GetHeight() + blur_radius;
87 {
Point(left, bottom)},
88 {
Point(right, bottom)},
100 VS::FrameInfo frame_info;
106 FS::FragInfo frag_info;
107 frag_info.color = color;
108 frag_info.blur_sigma = blur_sigma;
109 frag_info.rect_size =
Point(positive_rect.GetSize());
111 positive_rect.GetWidth() * 0.5f),
113 positive_rect.GetHeight() * 0.5f)};
120 VS::BindFrameInfo(pass,
122 FS::BindFragInfo(pass,
125 if (!pass.
Draw().ok()) {
134 color_ = color_filter_proc(color_);
Matrix GetShaderTransform(const RenderPass &pass) const
Get the vertex shader transform used for drawing this Entity.
float GetShaderClipDepth() const
const Matrix & GetTransform() const
Get the global transform matrix for this Entity.
constexpr float kEhCloseEnough
void SetSigma(Sigma sigma)
void SetColor(Color color)
FragmentShader_ FragmentShader
virtual bool SetVertexBuffer(VertexBuffer buffer)
Specify the vertex and index buffer to use for this command.
VertexBufferBuilder & AddVertices(std::initializer_list< VertexType_ > vertices)
static constexpr Matrix MakeTranslation(const Vector3 &t)
virtual void SetCommandLabel(std::string_view label)
The debugging label to use for the command.
virtual fml::Status Draw()
Record the currently pending command.
ContentContextOptions OptionsFromPassAndEntity(const RenderPass &pass, const Entity &entity)
std::function< Color(Color)> ColorFilterProc
static constexpr Color White()
In filters that use Gaussian distributions, "sigma" is a size of one standard deviation in terms of t...
std::shared_ptr< Pipeline< PipelineDescriptor > > GetRRectBlurPipeline(ContentContextOptions opts) const
bool is_for_rrect_blur_clear
bool ApplyColorFilter(const ColorFilterProc &color_filter_proc) override
If possible, applies a color filter to this contents inputs on the CPU.
virtual void SetStencilReference(uint32_t value)
BlendMode GetBlendMode() const
PrimitiveType primitive_type
VertexBuffer CreateVertexBuffer(HostBuffer &host_buffer) const
Render passes encode render commands directed as one specific render target into an underlying comman...
uint32_t GetClipDepth() const
bool Render(const ContentContext &renderer, const Entity &entity, RenderPass &pass) const override
BufferView EmplaceUniform(const UniformType &uniform)
Emplace uniform data onto the host buffer. Ensure that backend specific uniform alignment requirement...
void SetRRect(std::optional< Rect > rect, Size corner_radii={})
virtual void SetPipeline(const std::shared_ptr< Pipeline< PipelineDescriptor >> &pipeline)
The pipeline to use for this command.
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.
VertexShader_ VertexShader
constexpr Color Premultiply() const
HostBuffer & GetTransientsBuffer() const
Retrieve the currnent host buffer for transient storage.
~SolidRRectBlurContents() override