Flutter Engine
The Flutter Engine
Public Member Functions | Static Public Member Functions | List of all members
skgpu::Rectanizer Class Referenceabstract

#include <Rectanizer.h>

Inheritance diagram for skgpu::Rectanizer:
skgpu::RectanizerPow2 skgpu::RectanizerSkyline

Public Member Functions

 Rectanizer (int width, int height)
 
virtual ~Rectanizer ()
 
virtual void reset ()=0
 
int width () const
 
int height () const
 
virtual bool addRect (int width, int height, SkIPoint16 *loc)=0
 
virtual float percentFull () const =0
 
bool addPaddedRect (int width, int height, int16_t padding, SkIPoint16 *loc)
 

Static Public Member Functions

static RectanizerFactory (int width, int height)
 

Detailed Description

Definition at line 15 of file Rectanizer.h.

Constructor & Destructor Documentation

◆ Rectanizer()

skgpu::Rectanizer::Rectanizer ( int  width,
int  height 
)
inline

Definition at line 17 of file Rectanizer.h.

17 : fWidth(width), fHeight(height) {
18 SkASSERT(width >= 0);
19 SkASSERT(height >= 0);
20 }
#define SkASSERT(cond)
Definition: SkAssert.h:116
int width() const
Definition: Rectanizer.h:26
int height() const
Definition: Rectanizer.h:27

◆ ~Rectanizer()

virtual skgpu::Rectanizer::~Rectanizer ( )
inlinevirtual

Definition at line 22 of file Rectanizer.h.

22{}

Member Function Documentation

◆ addPaddedRect()

bool skgpu::Rectanizer::addPaddedRect ( int  width,
int  height,
int16_t  padding,
SkIPoint16 loc 
)
inline

Definition at line 34 of file Rectanizer.h.

34 {
35 if (this->addRect(width + 2*padding, height + 2*padding, loc)) {
36 loc->fX += padding;
37 loc->fY += padding;
38 return true;
39 }
40 return false;
41 }
virtual bool addRect(int width, int height, SkIPoint16 *loc)=0
int16_t fY
y-axis value used by SkIPoint16
Definition: SkIPoint16.h:20
int16_t fX
x-axis value used by SkIPoint16
Definition: SkIPoint16.h:18

◆ addRect()

virtual bool skgpu::Rectanizer::addRect ( int  width,
int  height,
SkIPoint16 loc 
)
pure virtual

◆ Factory()

Rectanizer * skgpu::Rectanizer::Factory ( int  width,
int  height 
)
static

Our factory, which returns the subclass du jour

Definition at line 125 of file RectanizerSkyline.cpp.

125 {
126 return new RectanizerSkyline(width, height);
127}

◆ height()

int skgpu::Rectanizer::height ( ) const
inline

Definition at line 27 of file Rectanizer.h.

27{ return fHeight; }

◆ percentFull()

virtual float skgpu::Rectanizer::percentFull ( ) const
pure virtual

◆ reset()

virtual void skgpu::Rectanizer::reset ( )
pure virtual

◆ width()

int skgpu::Rectanizer::width ( ) const
inline

Definition at line 26 of file Rectanizer.h.

26{ return fWidth; }

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