15 : geometry_(geometry) {}
40 const Entity& entity)
const {
46 if (geometry ==
nullptr) {
59 VS::FrameInfo frame_info;
60 FS::FragInfo frag_info;
68 return ColorSourceContents::DrawGeometry<VS>(
69 renderer, entity, pass, pipeline_callback, frame_info,
70 [&frag_info, &data_host_buffer](
RenderPass& pass) {
71 FS::BindFragInfo(pass, data_host_buffer.EmplaceUniform(frag_info));
79 ISize target_size)
const {
81 if (geometry ==
nullptr) {
87 : std::optional<Color>();
92 color_ = color_filter_proc(color_);
Scalar GetOpacityFactor() const
Get the opacity factor for this color source.
bool AppliesAlphaForStrokeCoverage(const Matrix &transform) const
Whether the entity should be treated as non-opaque due to stroke geometry requiring alpha for coverag...
std::function< PipelineRef(ContentContextOptions)> PipelineBuilderCallback
PipelineRef GetSolidFillPipeline(ContentContextOptions opts) const
HostBuffer & GetTransientsDataBuffer() const
Retrieve the current host buffer for transient storage of other non-index data.
std::function< Color(Color)> ColorFilterProc
const Matrix & GetTransform() const
Get the global transform matrix for this Entity.
virtual Scalar ComputeAlphaCoverage(const Matrix &transform) const
virtual bool CoversArea(const Matrix &transform, const IRect &rect) const
Determines if this geometry, transformed by the given transform, will completely cover all of the pix...
virtual std::optional< Rect > GetCoverage(const Matrix &transform) const =0
The coverage rectangle of this geometry, transformed by the transform argument.
Render passes encode render commands directed as one specific render target into an underlying comman...
virtual void SetCommandLabel(std::string_view label)
The debugging label to use for the command.
VertexShader_ VertexShader
FragmentShader_ FragmentShader
~SolidColorContents() override
bool IsOpaque(const Matrix &transform) const override
Whether this Contents only emits opaque source colors from the fragment stage. This value does not ac...
bool IsSolidColor() const override
void SetColor(Color color)
bool ApplyColorFilter(const ColorFilterProc &color_filter_proc) override
If possible, applies a color filter to this contents inputs on the CPU.
SolidColorContents(const Geometry *geometry)
bool Render(const ContentContext &renderer, const Entity &entity, RenderPass &pass) const override
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 ...
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.
const Geometry * GetGeometry() const override
Get the geometry that this contents will use to render.
LinePipeline::FragmentShader FS
LinePipeline::VertexShader VS
constexpr bool IsOpaque() const
constexpr Color WithAlpha(Scalar new_alpha) const
constexpr Color Premultiply() const
A 4x4 matrix using column-major storage.
constexpr static TRect MakeSize(const TSize< U > &size)