| Flutter Impeller |

Public Member Functions | List of all members
impeller::RectPathSource Class Reference

A PathSource object that provides path iteration for any TRect. More...

`#include <path_source.h>`

Inheritance diagram for impeller::RectPathSource:

## Public Member Functions
template<class T >
| RectPathSource (const TRect< T > &r)
| ~RectPathSource ()
FillType | GetFillType () const override
Rect | GetBounds () const override
bool | IsConvex () const override
void | Dispatch (PathReceiver &receiver) const override
Public Member Functions inherited from impeller::PathSource
virtual | ~PathSource ()=default

## Detailed Description

A PathSource object that provides path iteration for any TRect.

Definition at line 65 of file path_source.h.

## Constructor & Destructor Documentation

## ◆ RectPathSource()

template<class T >

impeller::RectPathSource::RectPathSource | ( | const TRect< T > & | r | ) |
| inline explicit

Definition at line 68 of file path_source.h.

68 : rect_(r) {}

## ◆ ~RectPathSource()

impeller::RectPathSource::~RectPathSource | ( |  | ) |
| default

## Member Function Documentation

## ◆ Dispatch()

void impeller::RectPathSource::Dispatch | ( | PathReceiver & | receiver | ) | const
| override virtual

Implements impeller::PathSource.

Definition at line 23 of file path_source.cc.

23 {
24 receiver.MoveTo(rect_.GetLeftTop(), true);
25 receiver.LineTo(rect_.GetRightTop());
26 receiver.LineTo(rect_.GetRightBottom());
27 receiver.LineTo(rect_.GetLeftBottom());
28 receiver.LineTo(rect_.GetLeftTop());
29 receiver.Close();
30 }
impeller::TRect::GetLeftBottom
constexpr TPoint< T > GetLeftBottom() const
Definition: rect.h:367
impeller::TRect::GetRightTop
constexpr TPoint< T > GetRightTop() const
Definition: rect.h:363
impeller::TRect::GetRightBottom
constexpr TPoint< T > GetRightBottom() const
Definition: rect.h:371
impeller::TRect::GetLeftTop
constexpr TPoint< T > GetLeftTop() const
Definition: rect.h:359

References impeller::PathReceiver::Close(), impeller::TRect< T >::GetLeftBottom(), impeller::TRect< T >::GetLeftTop(), impeller::TRect< T >::GetRightBottom(), impeller::TRect< T >::GetRightTop(), impeller::PathReceiver::LineTo(), and impeller::PathReceiver::MoveTo().

Referenced by impeller::testing::TEST().

## ◆ GetBounds()

Rect impeller::RectPathSource::GetBounds | ( |  | ) | const
| override virtual

Implements impeller::PathSource.

Definition at line 19 of file path_source.cc.

19 {
20 return rect_;
21 }

Referenced by impeller::testing::TEST().

## ◆ GetFillType()

FillType impeller::RectPathSource::GetFillType | ( |  | ) | const
| override virtual

Implements impeller::PathSource.

Definition at line 15 of file path_source.cc.

15 {
16 return FillType::kNonZero;
17 }
impeller::FillType::kNonZero
@ kNonZero

References impeller::kNonZero.

Referenced by impeller::testing::TEST().

## ◆ IsConvex()

bool impeller::RectPathSource::IsConvex | ( |  | ) | const
| override virtual

Implements impeller::PathSource.

Definition at line 11 of file path_source.cc.

11 {
12 return true;
13 }

Referenced by impeller::testing::TEST().

The documentation for this class was generated from the following files:

- impeller/geometry/path_source.h
- impeller/geometry/path_source.cc