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

#include <AtlasTypes.h>

Public Member Functions

std::array< uint16_t, 4 > getUVs () const
 
void invalidatePlotLocator ()
 
PlotLocator plotLocator () const
 
uint32_t pageIndex () const
 
uint32_t plotIndex () const
 
uint64_t genID () const
 
SkIPoint topLeft () const
 
SkPoint widthHeight () const
 
uint16_t width () const
 
uint16_t height () const
 
void insetSrc (int padding)
 
void updatePlotLocator (PlotLocator p)
 
void updateRect (skgpu::IRect16 rect)
 

Detailed Description

Definition at line 292 of file AtlasTypes.h.

Member Function Documentation

◆ genID()

uint64_t skgpu::AtlasLocator::genID ( ) const
inline

Definition at line 307 of file AtlasTypes.h.

307{ return fPlotLocator.genID(); }
uint64_t genID() const
Definition AtlasTypes.h:280

◆ getUVs()

std::array< uint16_t, 4 > skgpu::AtlasLocator::getUVs ( ) const
inline

Definition at line 294 of file AtlasTypes.h.

294 {
295 return fUVs;
296 }

◆ height()

uint16_t skgpu::AtlasLocator::height ( ) const
inline

Definition at line 323 of file AtlasTypes.h.

323 {
324 return fUVs[3] - fUVs[1];
325 }

◆ insetSrc()

void skgpu::AtlasLocator::insetSrc ( int  padding)
inline

Definition at line 327 of file AtlasTypes.h.

327 {
328 SkASSERT(2 * padding <= this->width());
329 SkASSERT(2 * padding <= this->height());
330
331 fUVs[0] += padding;
332 fUVs[1] += padding;
333 fUVs[2] -= padding;
334 fUVs[3] -= padding;
335 }
#define SkASSERT(cond)
Definition SkAssert.h:116
uint16_t height() const
Definition AtlasTypes.h:323
uint16_t width() const
Definition AtlasTypes.h:319

◆ invalidatePlotLocator()

void skgpu::AtlasLocator::invalidatePlotLocator ( )
inline

Definition at line 298 of file AtlasTypes.h.

298{ fPlotLocator.makeInvalid(); }

◆ pageIndex()

uint32_t skgpu::AtlasLocator::pageIndex ( ) const
inline

Definition at line 303 of file AtlasTypes.h.

303{ return fPlotLocator.pageIndex(); }
uint32_t pageIndex() const
Definition AtlasTypes.h:278

◆ plotIndex()

uint32_t skgpu::AtlasLocator::plotIndex ( ) const
inline

Definition at line 305 of file AtlasTypes.h.

305{ return fPlotLocator.plotIndex(); }
uint32_t plotIndex() const
Definition AtlasTypes.h:279

◆ plotLocator()

PlotLocator skgpu::AtlasLocator::plotLocator ( ) const
inline

Definition at line 301 of file AtlasTypes.h.

301{ return fPlotLocator; }

◆ topLeft()

SkIPoint skgpu::AtlasLocator::topLeft ( ) const
inline

Definition at line 309 of file AtlasTypes.h.

309 {
310 return {fUVs[0] & 0x1FFF, fUVs[1]};
311 }

◆ updatePlotLocator()

void skgpu::AtlasLocator::updatePlotLocator ( PlotLocator  p)
inline

Definition at line 337 of file AtlasTypes.h.

337 {
338 fPlotLocator = p;
339 SkASSERT(fPlotLocator.pageIndex() <= 3);
340 uint16_t page = fPlotLocator.pageIndex() << 13;
341 fUVs[0] = (fUVs[0] & 0x1FFF) | page;
342 fUVs[2] = (fUVs[2] & 0x1FFF) | page;
343 }

◆ updateRect()

void skgpu::AtlasLocator::updateRect ( skgpu::IRect16  rect)
inline

Definition at line 345 of file AtlasTypes.h.

345 {
346 SkASSERT(rect.fLeft <= rect.fRight);
347 SkASSERT(rect.fRight <= 0x1FFF);
348 fUVs[0] = (fUVs[0] & 0xE000) | rect.fLeft;
349 fUVs[1] = rect.fTop;
350 fUVs[2] = (fUVs[2] & 0xE000) | rect.fRight;
351 fUVs[3] = rect.fBottom;
352 }
sk_sp< SkBlender > blender SkRect rect
Definition SkRecords.h:350

◆ width()

uint16_t skgpu::AtlasLocator::width ( ) const
inline

Definition at line 319 of file AtlasTypes.h.

319 {
320 return fUVs[2] - fUVs[0];
321 }

◆ widthHeight()

SkPoint skgpu::AtlasLocator::widthHeight ( ) const
inline

Definition at line 313 of file AtlasTypes.h.

313 {
314 auto width = fUVs[2] - fUVs[0],
315 height = fUVs[3] - fUVs[1];
316 return SkPoint::Make(width, height);
317 }
static constexpr SkPoint Make(float x, float y)

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