Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
skgpu::IRect16 Struct Reference

#include <AtlasTypes.h>

Public Member Functions

int width () const
 
int height () const
 
int area () const
 
bool isEmpty () const
 
void setEmpty ()
 
void set (int16_t left, int16_t top, int16_t right, int16_t bottom)
 
void set (const SkIRect &r)
 
void offset (int16_t dx, int16_t dy)
 

Static Public Member Functions

static IRect16 MakeEmpty ()
 
static IRect16 MakeWH (int16_t w, int16_t h)
 
static IRect16 MakeXYWH (int16_t x, int16_t y, int16_t w, int16_t h)
 
static IRect16 Make (const SkIRect &ir)
 

Public Attributes

int16_t fLeft
 
int16_t fTop
 
int16_t fRight
 
int16_t fBottom
 

Detailed Description

Definition at line 39 of file AtlasTypes.h.

Member Function Documentation

◆ area()

int skgpu::IRect16::area ( ) const
inline

Definition at line 68 of file AtlasTypes.h.

68{ return this->width() * this->height(); }
int height() const
Definition AtlasTypes.h:67
int width() const
Definition AtlasTypes.h:66

◆ height()

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

Definition at line 67 of file AtlasTypes.h.

67{ return fBottom - fTop; }
int16_t fBottom
Definition AtlasTypes.h:40

◆ isEmpty()

bool skgpu::IRect16::isEmpty ( ) const
inline

Definition at line 69 of file AtlasTypes.h.

69{ return fLeft >= fRight || fTop >= fBottom; }
int16_t fLeft
Definition AtlasTypes.h:40
int16_t fRight
Definition AtlasTypes.h:40

◆ Make()

static IRect16 skgpu::IRect16::Make ( const SkIRect ir)
inlinestatic

Definition at line 60 of file AtlasTypes.h.

60 {
61 IRect16 r;
62 r.set(ir);
63 return r;
64 }

◆ MakeEmpty()

static IRect16 skgpu::IRect16::MakeEmpty ( )
inlinestatic

Definition at line 42 of file AtlasTypes.h.

42 {
43 IRect16 r;
44 r.setEmpty();
45 return r;
46 }

◆ MakeWH()

static IRect16 skgpu::IRect16::MakeWH ( int16_t  w,
int16_t  h 
)
inlinestatic

Definition at line 48 of file AtlasTypes.h.

48 {
49 IRect16 r;
50 r.set(0, 0, w, h);
51 return r;
52 }
SkScalar w
SkScalar h

◆ MakeXYWH()

static IRect16 skgpu::IRect16::MakeXYWH ( int16_t  x,
int16_t  y,
int16_t  w,
int16_t  h 
)
inlinestatic

Definition at line 54 of file AtlasTypes.h.

54 {
55 IRect16 r;
56 r.set(x, y, x + w, y + h);
57 return r;
58 }
double y
double x

◆ offset()

void skgpu::IRect16::offset ( int16_t  dx,
int16_t  dy 
)
inline

Definition at line 87 of file AtlasTypes.h.

87 {
88 fLeft += dx;
89 fTop += dy;
90 fRight += dx;
91 fBottom += dy;
92 }
skia_private::AutoTArray< sk_sp< SkImageFilter > > filters TypedMatrix matrix TypedMatrix matrix SkScalar dx
Definition SkRecords.h:208

◆ set() [1/2]

void skgpu::IRect16::set ( const SkIRect r)
inline

Definition at line 80 of file AtlasTypes.h.

80 {
81 fLeft = SkToS16(r.fLeft);
82 fTop = SkToS16(r.fTop);
85 }
constexpr int16_t SkToS16(S x)
Definition SkTo.h:23
int32_t fBottom
larger y-axis bounds
Definition SkRect.h:36
int32_t fTop
smaller y-axis bounds
Definition SkRect.h:34
int32_t fLeft
smaller x-axis bounds
Definition SkRect.h:33
int32_t fRight
larger x-axis bounds
Definition SkRect.h:35

◆ set() [2/2]

void skgpu::IRect16::set ( int16_t  left,
int16_t  top,
int16_t  right,
int16_t  bottom 
)
inline

Definition at line 73 of file AtlasTypes.h.

73 {
74 fLeft = left;
75 fTop = top;
76 fRight = right;
77 fBottom = bottom;
78 }
static bool left(const SkPoint &p0, const SkPoint &p1)
static bool right(const SkPoint &p0, const SkPoint &p1)

◆ setEmpty()

void skgpu::IRect16::setEmpty ( )
inline

Definition at line 71 of file AtlasTypes.h.

71{ memset(this, 0, sizeof(*this)); }

◆ width()

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

Definition at line 66 of file AtlasTypes.h.

66{ return fRight - fLeft; }

Member Data Documentation

◆ fBottom

int16_t skgpu::IRect16::fBottom

Definition at line 40 of file AtlasTypes.h.

◆ fLeft

int16_t skgpu::IRect16::fLeft

Definition at line 40 of file AtlasTypes.h.

◆ fRight

int16_t skgpu::IRect16::fRight

Definition at line 40 of file AtlasTypes.h.

◆ fTop

int16_t skgpu::IRect16::fTop

Definition at line 40 of file AtlasTypes.h.


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