32 : coverage_rect_(coverage_rect),
33 is_axis_aligned_rect_(is_axis_aligned_rect) {}
38 clip_geometry_ = std::move(clip_geometry);
46 const std::optional<Rect>& current_clip_coverage)
const {
47 if (!current_clip_coverage.has_value()) {
55 .is_difference_or_non_square =
true,
56 .coverage = current_clip_coverage
59 if (coverage_rect_.
IsEmpty() || !current_clip_coverage.has_value()) {
63 .is_difference_or_non_square = !is_axis_aligned_rect_,
64 .coverage = current_clip_coverage->Intersection(coverage_rect_),
72 uint32_t clip_depth)
const {
77 using VS = ClipPipeline::VertexShader;
85 options.primitive_type = clip_geometry_.
type;
94 options.depth_write_enabled =
true;
97 VS::BindFrameInfo(pass,
107 options.depth_write_enabled =
false;
108 switch (clip_geometry_.
mode) {
111 options.stencil_mode =
116 options.stencil_mode =
122 options.stencil_mode =
128 VS::BindFrameInfo(pass,
137 options.depth_write_enabled =
true;
143 options.stencil_mode =
150 cover_area = coverage_rect_;
160 VS::BindFrameInfo(pass,
ClipContents(Rect coverage_rect, bool is_axis_aligned_rect)
void SetGeometry(GeometryResult geometry)
Set the pre-tessellated clip geometry.
ClipCoverage GetClipCoverage(const std::optional< Rect > ¤t_clip_coverage) const
Given the current pass space bounding rectangle of the clip buffer, return the expected clip coverage...
void SetClipOperation(Entity::ClipOperation clip_op)
bool Render(const ContentContext &renderer, RenderPass &pass, uint32_t clip_depth) const
HostBuffer & GetTransientsDataBuffer() const
Retrieve the current host buffer for transient storage of other non-index data.
PipelineRef GetClipPipeline(ContentContextOptions opts) const
float GetShaderClipDepth() const
BufferView EmplaceUniform(const UniformType &uniform)
Emplace uniform data onto the host buffer. Ensure that backend specific uniform alignment requirement...
Render passes encode render commands directed as one specific render target into an underlying comman...
virtual bool SetVertexBuffer(VertexBuffer buffer)
Specify the vertex and index buffer to use for this command.
virtual void SetStencilReference(uint32_t value)
const Matrix & GetOrthographicTransform() const
virtual void SetPipeline(PipelineRef pipeline)
The pipeline to use for this command.
ISize GetRenderTargetSize() const
virtual fml::Status Draw()
Record the currently pending command.
virtual void SetCommandLabel(std::string_view label)
The debugging label to use for the command.
#define FML_UNREACHABLE()
static Scalar GetShaderClipDepth(uint32_t clip_depth)
VertexBuffer CreateVertexBuffer(std::array< VertexType, size > input, HostBuffer &data_host_buffer)
Create an index-less vertex buffer from a fixed size array.
LinePipeline::VertexShader VS
ContentContextOptions OptionsFromPass(const RenderPass &pass)
std::optional< Rect > coverage
This coverage is the outer coverage of the clip.
@ kNormal
The geometry has no overlapping triangles.
VertexBuffer vertex_buffer
constexpr std::array< TPoint< T >, 4 > GetPoints() const
Get the points that represent the 4 corners of this rectangle in a Z order that is compatible with tr...
constexpr bool IsEmpty() const
Returns true if either of the width or height are 0, negative, or NaN.
static constexpr TRect MakeSize(const TSize< U > &size)
std::vector< Point > points