Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | List of all members
GrDynamicAtlas::Node Class Reference

Public Member Functions

 Node (Node *previous, Rectanizer *rectanizer, int x, int y)
 
Nodeprevious () const
 
bool addRect (int w, int h, SkIPoint16 *loc)
 

Detailed Description

Definition at line 28 of file GrDynamicAtlas.cpp.

Constructor & Destructor Documentation

◆ Node()

GrDynamicAtlas::Node::Node ( Node previous,
Rectanizer rectanizer,
int  x,
int  y 
)
inline

Definition at line 30 of file GrDynamicAtlas.cpp.

31 : fPrevious(previous), fRectanizer(rectanizer), fX(x), fY(y) {}
Node * previous() const
double y
double x

Member Function Documentation

◆ addRect()

bool GrDynamicAtlas::Node::addRect ( int  w,
int  h,
SkIPoint16 loc 
)
inline

Definition at line 35 of file GrDynamicAtlas.cpp.

35 {
36 // Pad all paths except those that are expected to take up an entire physical texture.
37 if (w < fRectanizer->width()) {
38 w = std::min(w + kPadding, fRectanizer->width());
39 }
40 if (h < fRectanizer->height()) {
41 h = std::min(h + kPadding, fRectanizer->height());
42 }
43 if (!fRectanizer->addRect(w, h, loc)) {
44 return false;
45 }
46 loc->fX += fX;
47 loc->fY += fY;
48 return true;
49 }
static constexpr int kPadding
int width() const
Definition Rectanizer.h:26
int height() const
Definition Rectanizer.h:27
virtual bool addRect(int width, int height, SkIPoint16 *loc)=0
SkScalar w
SkScalar h
int32_t height
int32_t width
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

◆ previous()

Node * GrDynamicAtlas::Node::previous ( ) const
inline

Definition at line 33 of file GrDynamicAtlas.cpp.

33{ return fPrevious; }

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