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 
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  bool CanApplyMaskFilter() const override;
24 
25  private:
26  // |Geometry|
27  GeometryResult GetPositionBuffer(const ContentContext& renderer,
28  const Entity& entity,
29  RenderPass& pass) const override;
30 
31  // |Geometry|
32  GeometryVertexType GetVertexType() const override;
33 
34  // |Geometry|
35  std::optional<Rect> GetCoverage(const Matrix& transform) const override;
36 
37  // |Geometry|
38  GeometryResult GetPositionUVBuffer(Rect texture_coverage,
39  Matrix effect_transform,
40  const ContentContext& renderer,
41  const Entity& entity,
42  RenderPass& pass) const override;
43 
44  CoverGeometry(const CoverGeometry&) = delete;
45 
46  CoverGeometry& operator=(const CoverGeometry&) = delete;
47 };
48 
49 static_assert(std::is_trivially_destructible<CoverGeometry>::value);
50 
51 } // namespace impeller
52 
53 #endif // FLUTTER_IMPELLER_ENTITY_GEOMETRY_COVER_GEOMETRY_H_
impeller::CoverGeometry::CanApplyMaskFilter
bool CanApplyMaskFilter() const override
Definition: cover_geometry.cc:61
impeller::GeometryVertexType
GeometryVertexType
Definition: geometry.h:49
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:56
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:33
impeller::Geometry
Definition: geometry.h:83
impeller::CoverGeometry
A geometry that implements "drawPaint" like behavior by covering the entire render pass area.
Definition: cover_geometry.h:14
impeller
Definition: aiks_blur_unittests.cc:20
impeller::ContentContext
Definition: content_context.h:392
impeller::TRect< Scalar >
impeller::Matrix
A 4x4 matrix using column-major storage.
Definition: matrix.h:37