 |
Flutter Impeller
|
|
Go to the documentation of this file.
27 corner_radius_ = corner_radius;
43 const Entity& entity)
const {
44 if (!rect_.has_value()) {
50 auto ltrb = rect_->GetLTRB();
52 ltrb[2] + radius, ltrb[3] + radius);
70 auto blur_sigma = std::min(sigma_.
sigma, 250.0f);
73 auto blur_radius = blur_sigma * 2;
74 auto positive_rect = rect_->GetPositive();
76 auto left = -blur_radius;
77 auto top = -blur_radius;
78 auto right = positive_rect.size.width + blur_radius;
79 auto bottom = positive_rect.size.height + blur_radius;
84 {
Point(left, bottom)},
85 {
Point(left, bottom)},
87 {
Point(right, bottom)},
105 VS::FrameInfo frame_info;
111 FS::FragInfo frag_info;
112 frag_info.color = color;
113 frag_info.blur_sigma = blur_sigma;
114 frag_info.rect_size =
Point(positive_rect.size);
115 frag_info.corner_radius =
116 std::min(corner_radius_, std::min(positive_rect.size.width / 2.0f,
117 positive_rect.size.height / 2.0f));
129 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 float kEhCloseEnough
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