| Flutter Impeller |

arc_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_ARC_GEOMETRY_H_
6 #define FLUTTER_IMPELLER_ENTITY_GEOMETRY_ARC_GEOMETRY_H_
7
8 #include "impeller/entity/geometry/geometry.h"
9
10 #include "impeller/geometry/arc.h"
11 #include "impeller/geometry/stroke_parameters.h"
12
13 namespace impeller {
14
15 // Geometry class that can generate vertices (with or without texture
16 // coordinates) for either filled or stroked circles
17 class ArcGeometry final : public Geometry {
18 public:
19 explicit ArcGeometry(const Arc& arc);
20
21 explicit ArcGeometry(const Arc& arc, const StrokeParameters& stroke);
22
23 ~ArcGeometry() override;
24
25 // |Geometry|
26 bool CoversArea(const Matrix& transform, const Rect& rect) const override;
27
28 // |Geometry|
29 bool IsAxisAlignedRect() const override;
30
31 // |Geometry|
32 Scalar ComputeAlphaCoverage(const Matrix& transform) const override;
33
34 private:
35 // |Geometry|
36 GeometryResult GetPositionBuffer(const ContentContext& renderer,
37 const Entity& entity,
38 RenderPass& pass) const override;
39
40 // |Geometry|
41 std::optional<Rect> GetCoverage(const Matrix& transform) const override;
42
43 Arc arc_;
44 Scalar stroke_width_;
45 Cap cap_;
46
47 ArcGeometry(const ArcGeometry&) = delete;
48
49 ArcGeometry& operator=(const ArcGeometry&) = delete;
50 };
51
52 } // namespace impeller
53
54 #endif // FLUTTER_IMPELLER_ENTITY_GEOMETRY_ARC_GEOMETRY_H_
arc.h
impeller::ArcGeometry
Definition: arc_geometry.h:17
impeller::ArcGeometry::~ArcGeometry
~ArcGeometry() override
impeller::ArcGeometry::IsAxisAlignedRect
bool IsAxisAlignedRect() const override
Definition: arc_geometry.cc:79
impeller::ArcGeometry::ComputeAlphaCoverage
Scalar ComputeAlphaCoverage(const Matrix &transform) const override
Definition: arc_geometry.cc:23
impeller::ArcGeometry::CoversArea
bool CoversArea(const Matrix &transform, const Rect &rect) const override
Determines if this geometry, transformed by the given transform, will completely cover all surface ar...
Definition: arc_geometry.cc:75
impeller::ArcGeometry::ArcGeometry
ArcGeometry(const Arc &arc)
Definition: arc_geometry.cc:11
impeller::ContentContext
Definition: content_context.h:138
impeller::Entity
Definition: entity.h:26
impeller::Geometry
Definition: geometry.h:50
impeller::RenderPass
Render passes encode render commands directed as one specific render target into an underlying comman...
Definition: render_pass.h:30
transform
Matrix transform
Definition: gaussian_blur_filter_contents.cc:214
geometry.h
impeller
Definition: allocation.cc:12
impeller::Scalar
float Scalar
Definition: scalar.h:19
impeller::Cap
Cap
An enum that describes ways to decorate the end of a path contour.
Definition: stroke_parameters.h:13
stroke_parameters.h
impeller::Arc
Definition: arc.h:13
impeller::GeometryResult
Definition: geometry.h:21
impeller::Matrix
A 4x4 matrix using column-major storage.
Definition: matrix.h:37
impeller::StrokeParameters
A structure to store all of the parameters related to stroking a path or basic geometry object.
Definition: stroke_parameters.h:28
impeller::TRect< Scalar >