27 if (determinant == 0) {
31 Scalar min_size = 1.0f / sqrt(std::abs(determinant));
32 Scalar radius = std::max(radius_, min_size);
34 HostBuffer& host_buffer = renderer.GetTransientsBuffer();
41 renderer.GetTessellator()->FilledCircle(
transform, {}, radius);
43 std::vector<Point> circle_vertices;
44 circle_vertices.reserve(generator.GetVertexCount());
45 generator.GenerateVertices([&circle_vertices](
const Point& p) {
46 circle_vertices.push_back(p);
48 FML_DCHECK(circle_vertices.size() == generator.GetVertexCount());
50 vtx_builder.
Reserve((circle_vertices.size() + 2) * points_.size() - 2);
51 for (
auto&
center : points_) {
57 for (
auto& vertex : circle_vertices) {
62 vtx_builder.
Reserve(6 * points_.size() - 2);
63 for (
auto& point : points_) {
64 auto first =
Point(point.x - radius, point.y - radius);
73 vtx_builder.
AppendVertex({{point.x + radius, point.y - radius}});
74 vtx_builder.
AppendVertex({{point.x - radius, point.y + radius}});
75 vtx_builder.
AppendVertex({{point.x + radius, point.y + radius}});
89 if (points_.size() > 0) {
92 auto first = points_.begin();
93 auto last = points_.end();
96 auto right = first->x;
97 auto bottom = first->y;
98 for (
auto it = first + 1; it < last; ++it) {
100 top = std::min(top, it->y);
102 bottom = std::max(bottom, it->y);
105 right + radius_, bottom + radius_);
106 return coverage.TransformBounds(
transform);
static void round(SkPoint *p)
static const int points[]
static bool left(const SkPoint &p0, const SkPoint &p1)
static bool right(const SkPoint &p0, const SkPoint &p1)
static SkScalar center(float pos0, float pos1)
Matrix GetShaderTransform(const RenderPass &pass) const
Get the vertex shader transform used for drawing this Entity.
const Matrix & GetTransform() const
Get the global transform matrix for this Entity.
std::optional< Rect > GetCoverage(const Matrix &transform) const override
PointFieldGeometry(std::vector< Point > points, Scalar radius, bool round)
GeometryResult GetPositionBuffer(const ContentContext &renderer, const Entity &entity, RenderPass &pass) const override
Render passes encode render commands directed as one specific render target into an underlying comman...
VertexBuffer CreateVertexBuffer(HostBuffer &host_buffer) const
VertexBufferBuilder & AppendVertex(VertexType_ vertex)
const VertexType & Last() const
void Reserve(size_t count)
#define FML_DCHECK(condition)
static SkColor4f transform(SkColor4f c, SkColorSpace *src, SkColorSpace *dst)
A 4x4 matrix using column-major storage.
static constexpr TRect MakeLTRB(Type left, Type top, Type right, Type bottom)