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 #ifndef FLUTTER_IMPELLER_ENTITY_GEOMETRY_POINT_FIELD_GEOMETRY_H_
6 #define FLUTTER_IMPELLER_ENTITY_GEOMETRY_POINT_FIELD_GEOMETRY_H_
7 
9 
10 namespace impeller {
11 
12 class PointFieldGeometry final : public Geometry {
13  public:
14  PointFieldGeometry(std::vector<Point> points, Scalar radius, bool round);
15 
16  ~PointFieldGeometry() = default;
17 
18  static size_t ComputeCircleDivisions(Scalar scaled_radius, bool round);
19 
20  private:
21  // |Geometry|
22  GeometryResult GetPositionBuffer(const ContentContext& renderer,
23  const Entity& entity,
24  RenderPass& pass) const override;
25 
26  // |Geometry|
27  GeometryResult GetPositionUVBuffer(Rect texture_coverage,
28  Matrix effect_transform,
29  const ContentContext& renderer,
30  const Entity& entity,
31  RenderPass& pass) const override;
32 
33  // |Geometry|
34  GeometryVertexType GetVertexType() const override;
35 
36  // |Geometry|
37  std::optional<Rect> GetCoverage(const Matrix& transform) const override;
38 
39  GeometryResult GetPositionBufferGPU(
40  const ContentContext& renderer,
41  const Entity& entity,
42  RenderPass& pass,
43  std::optional<Rect> texture_coverage = std::nullopt,
44  std::optional<Matrix> effect_transform = std::nullopt) const;
45 
46  std::optional<VertexBufferBuilder<SolidFillVertexShader::PerVertexData>>
47  GetPositionBufferCPU(const ContentContext& renderer,
48  const Entity& entity,
49  RenderPass& pass) const;
50 
51  std::vector<Point> points_;
52  Scalar radius_;
53  bool round_;
54 
55  PointFieldGeometry(const PointFieldGeometry&) = delete;
56 
57  PointFieldGeometry& operator=(const PointFieldGeometry&) = delete;
58 };
59 
60 } // namespace impeller
61 
62 #endif // FLUTTER_IMPELLER_ENTITY_GEOMETRY_POINT_FIELD_GEOMETRY_H_
impeller::Scalar
float Scalar
Definition: scalar.h:18
impeller::PointFieldGeometry
Definition: point_field_geometry.h:12
impeller::PointFieldGeometry::PointFieldGeometry
PointFieldGeometry(std::vector< Point > points, Scalar radius, bool round)
Definition: point_field_geometry.cc:12
impeller::GeometryVertexType
GeometryVertexType
Definition: geometry.h:49
impeller::Entity
Definition: entity.h:21
geometry.h
impeller::GeometryResult
Definition: geometry.h:20
impeller::RenderPass
Render passes encode render commands directed as one specific render target into an underlying comman...
Definition: render_pass.h:33
impeller::PointFieldGeometry::~PointFieldGeometry
~PointFieldGeometry()=default
impeller::Geometry
Definition: geometry.h:83
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:238
impeller
Definition: aiks_blur_unittests.cc:20
impeller::ContentContext
Definition: content_context.h:392
impeller::TRect< Scalar >
impeller::Matrix
A 4x4 matrix using column-major storage.
Definition: matrix.h:37