Flutter Impeller
impeller::RectPathSource Class Reference

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

#include <path_source.h>

Inheritance diagram for impeller::RectPathSource:
impeller::PathSource

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)
inlineexplicit

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
overridevirtual

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 }
constexpr TPoint< T > GetLeftBottom() const
Definition: rect.h:371
constexpr TPoint< T > GetRightTop() const
Definition: rect.h:367
constexpr TPoint< T > GetRightBottom() const
Definition: rect.h:375
constexpr TPoint< T > GetLeftTop() const
Definition: rect.h:363

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
overridevirtual

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
overridevirtual

Implements impeller::PathSource.

Definition at line 15 of file path_source.cc.

15  {
16  return FillType::kNonZero;
17 }

References impeller::kNonZero.

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

◆ IsConvex()

bool impeller::RectPathSource::IsConvex ( ) const
overridevirtual

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: