A base class for SolidRRectBlurContents and SolidRSuperellipseBlurContents. More...
#include <solid_rrect_like_blur_contents.h>
Classes | |
struct | PassContext |
Public Member Functions | |
~SolidRRectLikeBlurContents () override | |
void | SetShape (Rect rect, Scalar corner_radius) |
void | SetSigma (Sigma sigma) |
void | SetColor (Color color) |
Color | GetColor () const |
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. More... | |
bool | Render (const ContentContext &renderer, const Entity &entity, RenderPass &pass) const override |
bool | ApplyColorFilter (const ColorFilterProc &color_filter_proc) override |
If possible, applies a color filter to this contents inputs on the CPU. More... | |
![]() | |
Contents () | |
virtual | ~Contents () |
void | SetCoverageHint (std::optional< Rect > coverage_hint) |
Hint that specifies the coverage area of this Contents that will actually be used during rendering. This is for optimization purposes only and can not be relied on as a clip. May optionally affect the result of GetCoverage() . More... | |
const std::optional< Rect > & | GetCoverageHint () const |
virtual bool | IsOpaque (const Matrix &transform) const |
Whether this Contents only emits opaque source colors from the fragment stage. This value does not account for any entity properties (e.g. the blend mode), clips/visibility culling, or inherited opacity. More... | |
virtual std::optional< Snapshot > | RenderToSnapshot (const ContentContext &renderer, const Entity &entity, std::optional< Rect > coverage_limit=std::nullopt, const std::optional< SamplerDescriptor > &sampler_descriptor=std::nullopt, bool msaa_enabled=true, int32_t mip_count=1, std::string_view label="Snapshot") const |
Render this contents to a snapshot, respecting the entity's transform, path, clip depth, and blend mode. The result texture size is always the size of GetCoverage(entity) . More... | |
std::optional< Size > | GetColorSourceSize () const |
Return the color source's intrinsic size, if available. More... | |
void | SetColorSourceSize (Size size) |
virtual void | SetInheritedOpacity (Scalar opacity) |
Inherit the provided opacity. More... | |
virtual std::optional< Color > | AsBackgroundColor (const Entity &entity, ISize target_size) const |
Returns a color if this Contents will flood the given target_size with a color. This output color is the "Source" color that will be used for the Entity's blend operation. More... | |
Protected Member Functions | |
SolidRRectLikeBlurContents () | |
virtual bool | SetPassInfo (RenderPass &pass, const ContentContext &renderer, PassContext &pass_context) const =0 |
Rect | GetRect () const |
Scalar | GetCornerRadius () const |
Sigma | GetSigma () const |
Static Protected Member Functions | |
static Vector4 | Concat (Vector2 &a, Vector2 &b) |
Additional Inherited Members | |
![]() | |
using | ColorFilterProc = std::function< Color(Color)> |
using | RenderProc = std::function< bool(const ContentContext &renderer, const Entity &entity, RenderPass &pass)> |
using | CoverageProc = std::function< std::optional< Rect >(const Entity &entity)> |
![]() | |
static std::shared_ptr< Contents > | MakeAnonymous (RenderProc render_proc, CoverageProc coverage_proc) |
A base class for SolidRRectBlurContents and SolidRSuperellipseBlurContents.
Definition at line 20 of file solid_rrect_like_blur_contents.h.
|
overridedefault |
|
protecteddefault |
|
overridevirtual |
If possible, applies a color filter to this contents inputs on the CPU.
This method will either fully apply the color filter or perform no action. Partial/incorrect application of the color filter will never occur.
[in] | color_filter_proc | A function that filters a given unpremultiplied color to produce a new unpremultiplied color. |
Reimplemented from impeller::Contents.
Definition at line 187 of file solid_rrect_like_blur_contents.cc.
Definition at line 193 of file solid_rrect_like_blur_contents.cc.
References impeller::saturated::b, impeller::TPoint< T >::x, and impeller::TPoint< T >::y.
Referenced by impeller::SolidRRectBlurContents::SetPassInfo().
Color impeller::SolidRRectLikeBlurContents::GetColor | ( | ) | const |
Definition at line 46 of file solid_rrect_like_blur_contents.cc.
Referenced by impeller::SolidRRectBlurContents::SetPassInfo().
|
inlineprotected |
Definition at line 66 of file solid_rrect_like_blur_contents.h.
|
overridevirtual |
Get the area of the render pass that will be affected when this contents is rendered.
During rendering, coverage coordinates count pixels from the top left corner of the framebuffer.
std::nullopt
result means that rendering this contents has no effect on the output color. Implements impeller::Contents.
Definition at line 108 of file solid_rrect_like_blur_contents.cc.
References impeller::TRect< T >::Expand(), impeller::Entity::GetTransform(), impeller::Sigma::sigma, and impeller::TRect< T >::TransformBounds().
|
inlineprotected |
Definition at line 65 of file solid_rrect_like_blur_contents.h.
|
inlineprotected |
Definition at line 67 of file solid_rrect_like_blur_contents.h.
|
overridevirtual |
Implements impeller::Contents.
Definition at line 115 of file solid_rrect_like_blur_contents.cc.
References impeller::Matrix::Basis(), blur_radius, impeller::CreateVertexBuffer(), impeller::RenderPass::Draw(), impeller::Entity::GetBlendMode(), impeller::TRect< T >::GetCenter(), impeller::TRect< T >::GetHeight(), impeller::TRect< T >::GetOrigin(), impeller::TRect< T >::GetPositive(), impeller::Entity::GetShaderClipDepth(), impeller::Entity::GetShaderTransform(), impeller::TRect< T >::GetSize(), impeller::Entity::GetTransform(), impeller::ContentContext::GetTransientsBuffer(), impeller::TRect< T >::GetWidth(), impeller::Matrix::Invert(), impeller::ContentContextOptions::is_for_rrect_blur_clear, impeller::kClear, impeller::kEhCloseEnough, impeller::kTriangleStrip, impeller::Matrix::MakeTranslation(), impeller::OptionsFromPassAndEntity(), impeller::SolidRRectLikeBlurContents::PassContext::opts, impeller::ContentContextOptions::primitive_type, SetPassInfo(), impeller::RenderPass::SetVertexBuffer(), impeller::Sigma::sigma, impeller::Color::White(), impeller::TPoint< T >::x, and impeller::TPoint< T >::y.
void impeller::SolidRRectLikeBlurContents::SetColor | ( | Color | color | ) |
Definition at line 42 of file solid_rrect_like_blur_contents.cc.
References impeller::Color::Premultiply().
|
protectedpure virtual |
Implemented in impeller::SolidRRectBlurContents.
Referenced by Render().
Definition at line 33 of file solid_rrect_like_blur_contents.cc.
void impeller::SolidRRectLikeBlurContents::SetSigma | ( | Sigma | sigma | ) |
Definition at line 38 of file solid_rrect_like_blur_contents.cc.