67 Point top_right_center_relative = top_right.
offset - center;
68 Point bottom_right_center_relative = bottom_right.
offset - center;
69 Point bottom_left_center_relative = bottom_left.
offset - center;
70 Point top_left_center_relative = top_left.
offset - center;
74 VS::FrameInfo frame_info;
75 FS::FragInfo frag_info;
78 frag_info.center = center;
79 frag_info.size = size;
80 frag_info.stroked = stroke_ ? 1.0f : 0.0f;
81 frag_info.stroke_width = stroke_ ? stroke_->width : 0.0f;
83 frag_info.superellipse_degrees_top =
86 frag_info.superellipse_degrees_right =
89 frag_info.superellipse_semi_axes_top =
92 frag_info.superellipse_semi_axes_right =
99 frag_info.angle_spans_right =
104 frag_info.octant_offsets_c =
109 frag_info.radii_width =
112 frag_info.radii_height =
115 frag_info.circle_centers_top_x =
118 frag_info.circle_centers_top_y =
121 frag_info.circle_centers_right_x =
Vector4(
124 frag_info.circle_centers_right_y =
Vector4(
127 frag_info.superellipse_scales_x =
130 frag_info.superellipse_scales_y =
133 frag_info.quadrant_centers_x =
134 Vector4(bottom_right_center_relative.
x, top_right_center_relative.
x,
135 bottom_left_center_relative.
x, top_left_center_relative.
x);
136 frag_info.quadrant_centers_y =
137 Vector4(bottom_right_center_relative.
y, top_right_center_relative.
y,
138 bottom_left_center_relative.
y, top_left_center_relative.
y);
139 frag_info.quadrant_splits =
142 round_superellipse_params_.
left_split - center.y,
143 round_superellipse_params_.
right_split - center.y);
145 auto geometry_result =
153 return ColorSourceContents::DrawGeometry<VS>(
154 this,
GetGeometry(), renderer, entity, pass, pipeline_callback,
157 [&frag_info, &data_host_buffer](
RenderPass& pass) {
158 FS::BindFragInfo(pass, data_host_buffer.EmplaceUniform(frag_info));
Scalar GetOpacityFactor() const
Get the opacity factor for this color source.
std::function< PipelineRef(ContentContextOptions)> PipelineBuilderCallback
bool Render(const ContentContext &renderer, const Entity &entity, RenderPass &pass) const override
static std::unique_ptr< ComplexRoundedSuperellipseContents > Make(Color color, const Rect &bounds, const RoundSuperellipseParam &round_superellipse_params, std::optional< StrokeParameters > stroke)
const Geometry * GetGeometry() const override
Get the geometry that this contents will use to render.
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.
HostBuffer & GetTransientsDataBuffer() const
Retrieve the current host buffer for transient storage of other non-index data.
PipelineRef GetComplexRSEPipeline(ContentContextOptions opts) const
constexpr TRect< T > Expand(T left, T top, T right, T bottom) const
Returns a rectangle with expanded edges. Negative expansion results in shrinking.