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

#include <SkSize.h>

Public Member Functions

void set (int32_t w, int32_t h)
 
bool isZero () const
 
bool isEmpty () const
 
void setEmpty ()
 
constexpr int32_t width () const
 
constexpr int32_t height () const
 
constexpr int64_t area () const
 
bool equals (int32_t w, int32_t h) const
 

Static Public Member Functions

static constexpr SkISize Make (int32_t w, int32_t h)
 
static constexpr SkISize MakeEmpty ()
 

Public Attributes

int32_t fWidth
 
int32_t fHeight
 

Detailed Description

Definition at line 16 of file SkSize.h.

Member Function Documentation

◆ area()

constexpr int64_t SkISize::area ( ) const
inlineconstexpr

Definition at line 39 of file SkSize.h.

39{ return SkToS64(fWidth) * SkToS64(fHeight); }
constexpr int64_t SkToS64(S x)
Definition SkTo.h:27
int32_t fHeight
Definition SkSize.h:18
int32_t fWidth
Definition SkSize.h:17

◆ equals()

bool SkISize::equals ( int32_t  w,
int32_t  h 
) const
inline

Definition at line 41 of file SkSize.h.

41{ return fWidth == w && fHeight == h; }
SkScalar w
SkScalar h

◆ height()

constexpr int32_t SkISize::height ( ) const
inlineconstexpr

Definition at line 37 of file SkSize.h.

37{ return fHeight; }

◆ isEmpty()

bool SkISize::isEmpty ( ) const
inline

Returns true if either width or height are <= 0

Definition at line 31 of file SkSize.h.

31{ return fWidth <= 0 || fHeight <= 0; }

◆ isZero()

bool SkISize::isZero ( ) const
inline

Returns true iff fWidth == 0 && fHeight == 0

Definition at line 28 of file SkSize.h.

28{ return 0 == fWidth && 0 == fHeight; }

◆ Make()

static constexpr SkISize SkISize::Make ( int32_t  w,
int32_t  h 
)
inlinestaticconstexpr

Definition at line 20 of file SkSize.h.

20{ return {w, h}; }

◆ MakeEmpty()

static constexpr SkISize SkISize::MakeEmpty ( )
inlinestaticconstexpr

Definition at line 22 of file SkSize.h.

22{ return {0, 0}; }

◆ set()

void SkISize::set ( int32_t  w,
int32_t  h 
)
inline

Definition at line 24 of file SkSize.h.

24{ *this = SkISize{w, h}; }

◆ setEmpty()

void SkISize::setEmpty ( )
inline

Set the width and height to 0

Definition at line 34 of file SkSize.h.

34{ fWidth = fHeight = 0; }

◆ width()

constexpr int32_t SkISize::width ( ) const
inlineconstexpr

Definition at line 36 of file SkSize.h.

36{ return fWidth; }

Member Data Documentation

◆ fHeight

int32_t SkISize::fHeight

Definition at line 18 of file SkSize.h.

◆ fWidth

int32_t SkISize::fWidth

Definition at line 17 of file SkSize.h.


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