Flutter Engine Uber Docs
Docs for the entire Flutter Engine repo.
 
Loading...
Searching...
No Matches
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
9
12
13namespace impeller {
14
15// Geometry class that can generate vertices (with or without texture
16// coordinates) for either filled or stroked circles
17class 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 IRect& 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 // Whether the arc has overlapping stroke caps
44 bool CapsOverlap() const;
45
46 Arc arc_;
47 Scalar stroke_width_;
48 Cap cap_;
49
50 ArcGeometry(const ArcGeometry&) = delete;
51
52 ArcGeometry& operator=(const ArcGeometry&) = delete;
53};
54
55} // namespace impeller
56
57#endif // FLUTTER_IMPELLER_ENTITY_GEOMETRY_ARC_GEOMETRY_H_
bool CoversArea(const Matrix &transform, const IRect &rect) const override
Determines if this geometry, transformed by the given transform, will completely cover all of the pix...
bool IsAxisAlignedRect() const override
Scalar ComputeAlphaCoverage(const Matrix &transform) const override
Render passes encode render commands directed as one specific render target into an underlying comman...
Definition render_pass.h:30
float Scalar
Definition scalar.h:19
Cap
An enum that describes ways to decorate the end of a path contour.
A 4x4 matrix using column-major storage.
Definition matrix.h:37
A structure to store all of the parameters related to stroking a path or basic geometry object.