| Flutter Impeller |

cover_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_COVER_GEOMETRY_H_
6 #define FLUTTER_IMPELLER_ENTITY_GEOMETRY_COVER_GEOMETRY_H_
7
8 #include "impeller/entity/geometry/geometry.h"
9
10 namespace impeller {
11
12 /// @brief A geometry that implements "drawPaint" like behavior by covering
13 /// the entire render pass area.
14 class CoverGeometry final : public Geometry {
15 public:
16 CoverGeometry();
17
18 ~CoverGeometry() = default;
19
20 // |Geometry|
21 bool CoversArea(const Matrix& transform, const Rect& rect) const override;
22
23 private:
24 // |Geometry|
25 GeometryResult GetPositionBuffer(const ContentContext& renderer,
26 const Entity& entity,
27 RenderPass& pass) const override;
28
29 // |Geometry|
30 GeometryVertexType GetVertexType() const override;
31
32 // |Geometry|
33 std::optional<Rect> GetCoverage(const Matrix& transform) const override;
34
35 // |Geometry|
36 GeometryResult GetPositionUVBuffer(Rect texture_coverage,
37 Matrix effect_transform,
38 const ContentContext& renderer,
39 const Entity& entity,
40 RenderPass& pass) const override;
41
42 CoverGeometry(const CoverGeometry&) = delete;
43
44 CoverGeometry& operator=(const CoverGeometry&) = delete;
45 };
46
47 static_assert(std::is_trivially_destructible<CoverGeometry>::value);
48
49 } // namespace impeller
50
51 #endif // FLUTTER_IMPELLER_ENTITY_GEOMETRY_COVER_GEOMETRY_H_
impeller::GeometryVertexType
GeometryVertexType
Definition: geometry.h:34
impeller::CoverGeometry::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: cover_geometry.cc:57
impeller::Entity
Definition: entity.h:21
geometry.h
impeller::GeometryResult
Definition: geometry.h:20
impeller::CoverGeometry::CoverGeometry
CoverGeometry()
impeller::CoverGeometry::~CoverGeometry
~CoverGeometry()=default
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::CoverGeometry
A geometry that implements "drawPaint" like behavior by covering the entire render pass area.
Definition: cover_geometry.h:14
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