 |
Flutter Impeller
|
|
Go to the documentation of this file.
26 corner_radius_ = corner_radius;
42 const Entity& entity)
const {
43 if (!rect_.has_value()) {
49 auto ltrb = rect_->GetLTRB();
51 ltrb[2] + radius, ltrb[3] + radius);
58 if (!rect_.has_value()) {
68 auto blur_sigma = std::min(sigma_.
sigma, 250.0f);
71 auto blur_radius = blur_sigma * 2;
72 auto positive_rect = rect_->GetPositive();
74 auto left = -blur_radius;
75 auto top = -blur_radius;
76 auto right = positive_rect.size.width + blur_radius;
77 auto bottom = positive_rect.size.height + blur_radius;
82 {
Point(left, bottom)},
83 {
Point(left, bottom)},
85 {
Point(right, bottom)},
103 VS::FrameInfo frame_info;
109 FS::FragInfo frag_info;
110 frag_info.color = color;
111 frag_info.blur_sigma = blur_sigma;
112 frag_info.rect_size =
Point(positive_rect.size);
113 frag_info.corner_radius =
114 std::min(corner_radius_, std::min(positive_rect.size.width / 2.0f,
115 positive_rect.size.height / 2.0f));
127 color_ = color_filter_proc(color_);
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)
uint32_t GetStencilDepth() const
constexpr TRect TransformBounds(const Matrix &transform) const
Creates a new bounding box that contains this transformed rectangle.
void SetSigma(Sigma sigma)
void SetColor(Color color)
FragmentShader_ FragmentShader
VertexBufferBuilder & AddVertices(std::initializer_list< VertexType_ > vertices)
static constexpr Matrix MakeTranslation(const Vector3 &t)
const Matrix & GetTransformation() const
ContentContextOptions OptionsFromPassAndEntity(const RenderPass &pass, const Entity &entity)
ISize GetRenderTargetSize() const
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.
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 stencil_reference
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...
static constexpr Matrix MakeOrthographic(TSize< T > size)
constexpr static TRect MakeLTRB(Type left, Type top, Type right, Type bottom)
std::optional< Rect > GetCoverage(const Entity &entity) const override
Get the screen space bounding rectangle that this contents affects.
void SetRRect(std::optional< Rect > rect, Scalar corner_radius=0)
bool BindVertices(const VertexBuffer &buffer)
Specify the vertex and index buffer to use for this command.
std::shared_ptr< Pipeline< PipelineDescriptor > > pipeline
VertexShader_ VertexShader
bool AddCommand(Command &&command)
Record a command for subsequent encoding to the underlying command buffer. No work is encoded into th...
constexpr Color Premultiply() const
HostBuffer & GetTransientsBuffer()
~SolidRRectBlurContents() override