| Flutter Impeller |

rect_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_RECT_GEOMETRY_H_
6 #define FLUTTER_IMPELLER_ENTITY_GEOMETRY_RECT_GEOMETRY_H_
7
8 #include "impeller/entity/geometry/geometry.h"
9
10 namespace impeller {
11
12 class RectGeometry final : public Geometry {
13 public:
14 explicit RectGeometry(Rect rect);
15
16 ~RectGeometry() = default;
17
18 // |Geometry|
19 bool CoversArea(const Matrix& transform, const Rect& rect) const override;
20
21 // |Geometry|
22 bool IsAxisAlignedRect() const override;
23
24 private:
25 // |Geometry|
26 GeometryResult GetPositionBuffer(const ContentContext& renderer,
27 const Entity& entity,
28 RenderPass& pass) const override;
29
30 // |Geometry|
31 GeometryVertexType GetVertexType() const override;
32
33 // |Geometry|
34 std::optional<Rect> GetCoverage(const Matrix& transform) const override;
35
36 // |Geometry|
37 GeometryResult GetPositionUVBuffer(Rect texture_coverage,
38 Matrix effect_transform,
39 const ContentContext& renderer,
40 const Entity& entity,
41 RenderPass& pass) const override;
42
43 Rect rect_;
44
45 RectGeometry(const RectGeometry&) = delete;
46
47 RectGeometry& operator=(const RectGeometry&) = delete;
48 };
49
50 static_assert(std::is_trivially_destructible<RectGeometry>::value);
51
52 } // namespace impeller
53
54 #endif // FLUTTER_IMPELLER_ENTITY_GEOMETRY_RECT_GEOMETRY_H_
impeller::RectGeometry::IsAxisAlignedRect
bool IsAxisAlignedRect() const override
Definition: rect_geometry.cc:55
impeller::GeometryVertexType
GeometryVertexType
Definition: geometry.h:34
impeller::Entity
Definition: entity.h:21
impeller::RectGeometry::RectGeometry
RectGeometry(Rect rect)
Definition: rect_geometry.cc:9
geometry.h
impeller::RectGeometry
Definition: rect_geometry.h:12
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:29
impeller::Geometry
Definition: geometry.h:58
impeller::RectGeometry::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: rect_geometry.cc:47
impeller
Definition: aiks_context.cc:10
impeller::ContentContext
Definition: content_context.h:332
impeller::TRect< Scalar >
impeller::Matrix
A 4x4 matrix using column-major storage.
Definition: matrix.h:37
impeller::RectGeometry::~RectGeometry
~RectGeometry()=default