| Flutter Impeller |

point_field_geometry.h
Go to the documentation of this file.
1 // Copyright 2013 The Flutter Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #pragma once
6
7 #include "impeller/entity/geometry/geometry.h"
8
9 namespace impeller {
10
11 class PointFieldGeometry : public Geometry {
12 public:
13 PointFieldGeometry(std::vector<Point> points, Scalar radius, bool round);
14
15 ~PointFieldGeometry();
16
17 static size_t ComputeCircleDivisions(Scalar scaled_radius, bool round);
18
19 private:
20 // |Geometry|
21 GeometryResult GetPositionBuffer(const ContentContext& renderer,
22 const Entity& entity,
23 RenderPass& pass) override;
24
25 // |Geometry|
26 GeometryResult GetPositionUVBuffer(Rect texture_coverage,
27 Matrix effect_transform,
28 const ContentContext& renderer,
29 const Entity& entity,
30 RenderPass& pass) override;
31
32 // |Geometry|
33 GeometryVertexType GetVertexType() const override;
34
35 // |Geometry|
36 std::optional<Rect> GetCoverage(const Matrix& transform) const override;
37
38 GeometryResult GetPositionBufferGPU(
39 const ContentContext& renderer,
40 const Entity& entity,
41 RenderPass& pass,
42 std::optional<Rect> texture_coverage = std::nullopt,
43 std::optional<Matrix> effect_transform = std::nullopt);
44
45 std::optional<VertexBufferBuilder<SolidFillVertexShader::PerVertexData>>
46 GetPositionBufferCPU(const ContentContext& renderer,
47 const Entity& entity,
48 RenderPass& pass);
49
50 std::vector<Point> points_;
51 Scalar radius_;
52 bool round_;
53
54 FML_DISALLOW_COPY_AND_ASSIGN(PointFieldGeometry);
55 };
56
57 } // namespace impeller
impeller::Scalar
float Scalar
Definition: scalar.h:15
impeller::PointFieldGeometry
Definition: point_field_geometry.h:11
impeller::PointFieldGeometry::PointFieldGeometry
PointFieldGeometry(std::vector< Point > points, Scalar radius, bool round)
Definition: point_field_geometry.cc:12
impeller::GeometryVertexType
GeometryVertexType
Definition: geometry.h:25
impeller::Entity
Definition: entity.h:21
geometry.h
impeller::GeometryResult
Definition: geometry.h:18
impeller::RenderPass
Render passes encode render commands directed as one specific render target into an underlying comman...
Definition: render_pass.h:27
impeller::Geometry
Definition: geometry.h:54
impeller::PointFieldGeometry::ComputeCircleDivisions
static size_t ComputeCircleDivisions(Scalar scaled_radius, bool round)
Compute the number of vertices to divide each circle into.
Definition: point_field_geometry.cc:244
impeller::PointFieldGeometry::~PointFieldGeometry
~PointFieldGeometry()
impeller
Definition: aiks_context.cc:10
impeller::ContentContext
Definition: content_context.h:344
impeller::TRect< Scalar >
impeller::Matrix
A 4x4 matrix using column-major storage.
Definition: matrix.h:36