| Flutter Impeller |

ellipse_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_ELLIPSE_GEOMETRY_H_
6 #define FLUTTER_IMPELLER_ENTITY_GEOMETRY_ELLIPSE_GEOMETRY_H_
7
8 #include "impeller/entity/geometry/geometry.h"
9
10 namespace impeller {
11
12 // Geometry class that can generate vertices (with or without texture
13 // coordinates) for filled ellipses. Generating vertices for a stroked
14 // ellipse would require a lot more work since the line width must be
15 // applied perpendicular to the distorted ellipse shape.
16 class EllipseGeometry final : public Geometry {
17 public:
18 explicit EllipseGeometry(Rect bounds);
19
20 ~EllipseGeometry() override = default;
21
22 // |Geometry|
23 bool CoversArea(const Matrix& transform, const Rect& rect) const override;
24
25 // |Geometry|
26 bool IsAxisAlignedRect() const override;
27
28 private:
29 // |Geometry|
30 GeometryResult GetPositionBuffer(const ContentContext& renderer,
31 const Entity& entity,
32 RenderPass& pass) const override;
33
34 // |Geometry|
35 std::optional<Rect> GetCoverage(const Matrix& transform) const override;
36
37 Rect bounds_;
38
39 EllipseGeometry(const EllipseGeometry&) = delete;
40
41 EllipseGeometry& operator=(const EllipseGeometry&) = delete;
42 };
43
44 } // namespace impeller
45
46 #endif // FLUTTER_IMPELLER_ENTITY_GEOMETRY_ELLIPSE_GEOMETRY_H_
impeller::ContentContext
Definition: content_context.h:371
impeller::EllipseGeometry
Definition: ellipse_geometry.h:16
impeller::EllipseGeometry::EllipseGeometry
EllipseGeometry(Rect bounds)
Definition: ellipse_geometry.cc:13
impeller::EllipseGeometry::~EllipseGeometry
~EllipseGeometry() override=default
impeller::EllipseGeometry::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: ellipse_geometry.cc:30
impeller::EllipseGeometry::IsAxisAlignedRect
bool IsAxisAlignedRect() const override
Definition: ellipse_geometry.cc:35
impeller::Entity
Definition: entity.h:20
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::GeometryResult
Definition: geometry.h:21
impeller::Matrix
A 4x4 matrix using column-major storage.
Definition: matrix.h:37
impeller::TRect< Scalar >