| Flutter Impeller |

fill_path_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_FILL_PATH_GEOMETRY_H_
6 #define FLUTTER_IMPELLER_ENTITY_GEOMETRY_FILL_PATH_GEOMETRY_H_
7
8 #include <optional>
9
10 #include "impeller/entity/geometry/geometry.h"
11 #include "impeller/geometry/rect.h"
12
13 namespace impeller {
14
15 /// @brief A geometry that is created from a filled path object.
16 class FillPathGeometry final : public Geometry {
17 public:
18 explicit FillPathGeometry(Path path,
19 std::optional<Rect> inner_rect = std::nullopt);
20
21 ~FillPathGeometry() = default;
22
23 // |Geometry|
24 bool CoversArea(const Matrix& transform, const Rect& rect) const override;
25
26 private:
27 // |Geometry|
28 GeometryResult GetPositionBuffer(const ContentContext& renderer,
29 const Entity& entity,
30 RenderPass& pass) const override;
31
32 // |Geometry|
33 GeometryVertexType GetVertexType() const override;
34
35 // |Geometry|
36 std::optional<Rect> GetCoverage(const Matrix& transform) const override;
37
38 // |Geometry|
39 GeometryResult GetPositionUVBuffer(Rect texture_coverage,
40 Matrix effect_transform,
41 const ContentContext& renderer,
42 const Entity& entity,
43 RenderPass& pass) const override;
44
45 Path path_;
46 std::optional<Rect> inner_rect_;
47
48 FillPathGeometry(const FillPathGeometry&) = delete;
49
50 FillPathGeometry& operator=(const FillPathGeometry&) = delete;
51 };
52
53 } // namespace impeller
54
55 #endif // FLUTTER_IMPELLER_ENTITY_GEOMETRY_FILL_PATH_GEOMETRY_H_
impeller::FillPathGeometry::FillPathGeometry
FillPathGeometry(Path path, std::optional< Rect > inner_rect=std::nullopt)
Definition: fill_path_geometry.cc:10
impeller::GeometryVertexType
GeometryVertexType
Definition: geometry.h:34
impeller::Entity
Definition: entity.h:21
impeller::Path
Paths are lightweight objects that describe a collection of linear, quadratic, or cubic segments....
Definition: path.h:55
geometry.h
impeller::GeometryResult
Definition: geometry.h:20
impeller::FillPathGeometry::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: fill_path_geometry.cc:145
impeller::RenderPass
Render passes encode render commands directed as one specific render target into an underlying comman...
Definition: render_pass.h:29
impeller::Geometry
Definition: geometry.h:58
rect.h
impeller::FillPathGeometry
A geometry that is created from a filled path object.
Definition: fill_path_geometry.h:16
impeller
Definition: aiks_context.cc:10
impeller::ContentContext
Definition: content_context.h:332
impeller::TRect
Definition: rect.h:22
impeller::Matrix
A 4x4 matrix using column-major storage.
Definition: matrix.h:37
impeller::FillPathGeometry::~FillPathGeometry
~FillPathGeometry()=default