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 #pragma once
6 
7 #include <optional>
8 
10 #include "impeller/geometry/rect.h"
11 
12 namespace impeller {
13 
14 /// @brief A geometry that is created from a filled path object.
15 class FillPathGeometry : public Geometry {
16  public:
17  explicit FillPathGeometry(const Path& path,
18  std::optional<Rect> inner_rect = std::nullopt);
19 
21 
22  // |Geometry|
23  bool CoversArea(const Matrix& transform, const Rect& rect) const override;
24 
25  private:
26  // |Geometry|
27  GeometryResult GetPositionBuffer(const ContentContext& renderer,
28  const Entity& entity,
29  RenderPass& pass) 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) override;
43 
44  Path path_;
45  std::optional<Rect> inner_rect_;
46 
47  FML_DISALLOW_COPY_AND_ASSIGN(FillPathGeometry);
48 };
49 
50 } // namespace impeller
impeller::FillPathGeometry::~FillPathGeometry
~FillPathGeometry()
impeller::GeometryVertexType
GeometryVertexType
Definition: geometry.h:25
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:54
geometry.h
impeller::GeometryResult
Definition: geometry.h:18
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:161
impeller::RenderPass
Render passes encode render commands directed as one specific render target into an underlying comman...
Definition: render_pass.h:27
impeller::Geometry
Definition: geometry.h:54
rect.h
impeller::FillPathGeometry
A geometry that is created from a filled path object.
Definition: fill_path_geometry.h:15
impeller
Definition: aiks_context.cc:10
impeller::ContentContext
Definition: content_context.h:344
impeller::TRect
Definition: rect.h:20
impeller::Matrix
A 4x4 matrix using column-major storage.
Definition: matrix.h:36
impeller::FillPathGeometry::FillPathGeometry
FillPathGeometry(const Path &path, std::optional< Rect > inner_rect=std::nullopt)
Definition: fill_path_geometry.cc:10