#include <RectanizerPow2.h>
Definition at line 28 of file RectanizerPow2.h.
◆ RectanizerPow2()
skgpu::RectanizerPow2::RectanizerPow2 |
( |
int |
w, |
|
|
int |
h |
|
) |
| |
|
inline |
◆ ~RectanizerPow2()
skgpu::RectanizerPow2::~RectanizerPow2 |
( |
| ) |
|
|
inlinefinal |
◆ addRect()
Implements skgpu::Rectanizer.
Definition at line 12 of file RectanizerPow2.cpp.
12 {
13 if ((
unsigned)
width > (
unsigned)this->
width() ||
15 return false;
16 }
17
19
21 if (
height < kMIN_HEIGHT_POW2) {
23 }
24
25 Row* row = &fRows[HeightToRowIndex(
height)];
27
28 if (0 == row->fRowHeight) {
29 if (!this->canAddStrip(
height)) {
30 return false;
31 }
32 this->initRow(row,
height);
33 } else {
34 if (!row->canAddWidth(
width, this->width())) {
35 if (!this->canAddStrip(
height)) {
36 return false;
37 }
38
39
40 this->initRow(row,
height);
41 }
42 }
43
46 *loc = row->fLoc;
48
49 SkASSERT(row->fLoc.fX <= this->width());
50 SkASSERT(row->fLoc.fY <= this->height());
52 fAreaSoFar += area;
53 return true;
54}
static uint32_t GrNextPow2(uint32_t n)
int16_t fX
x-axis value used by SkIPoint16
◆ percentFull()
float skgpu::RectanizerPow2::percentFull |
( |
| ) |
const |
|
inlinefinalvirtual |
◆ reset()
void skgpu::RectanizerPow2::reset |
( |
| ) |
|
|
inlinefinalvirtual |
The documentation for this class was generated from the following files: