Flutter Engine
The Flutter Engine
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
SkSize Struct Reference

#include <SkSize.h>

Public Member Functions

void set (SkScalar w, SkScalar h)
 
bool isZero () const
 
bool isEmpty () const
 
void setEmpty ()
 
SkScalar width () const
 
SkScalar height () const
 
bool equals (SkScalar w, SkScalar h) const
 
SkISize toRound () const
 
SkISize toCeil () const
 
SkISize toFloor () const
 

Static Public Member Functions

static constexpr SkSize Make (SkScalar w, SkScalar h)
 
static constexpr SkSize Make (const SkISize &src)
 
static constexpr SkSize MakeEmpty ()
 

Public Attributes

SkScalar fWidth
 
SkScalar fHeight
 

Detailed Description

Definition at line 52 of file SkSize.h.

Member Function Documentation

◆ equals()

bool SkSize::equals ( SkScalar  w,
SkScalar  h 
) const
inline

Definition at line 79 of file SkSize.h.

79{ return fWidth == w && fHeight == h; }
SkScalar w
SkScalar h
SkScalar fHeight
Definition: SkSize.h:54
SkScalar fWidth
Definition: SkSize.h:53

◆ height()

SkScalar SkSize::height ( ) const
inline

Definition at line 77 of file SkSize.h.

77{ return fHeight; }

◆ isEmpty()

bool SkSize::isEmpty ( ) const
inline

Returns true if either width or height are <= 0

Definition at line 71 of file SkSize.h.

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

◆ isZero()

bool SkSize::isZero ( ) const
inline

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

Definition at line 68 of file SkSize.h.

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

◆ Make() [1/2]

static constexpr SkSize SkSize::Make ( const SkISize src)
inlinestaticconstexpr

Definition at line 58 of file SkSize.h.

58 {
59 return {SkIntToScalar(src.width()), SkIntToScalar(src.height())};
60 }
#define SkIntToScalar(x)
Definition: SkScalar.h:57

◆ Make() [2/2]

static constexpr SkSize SkSize::Make ( SkScalar  w,
SkScalar  h 
)
inlinestaticconstexpr

Definition at line 56 of file SkSize.h.

56{ return {w, h}; }

◆ MakeEmpty()

static constexpr SkSize SkSize::MakeEmpty ( )
inlinestaticconstexpr

Definition at line 62 of file SkSize.h.

62{ return {0, 0}; }

◆ set()

void SkSize::set ( SkScalar  w,
SkScalar  h 
)
inline

Definition at line 64 of file SkSize.h.

64{ *this = SkSize{w, h}; }
Definition: SkSize.h:52

◆ setEmpty()

void SkSize::setEmpty ( )
inline

Set the width and height to 0

Definition at line 74 of file SkSize.h.

74{ *this = SkSize{0, 0}; }

◆ toCeil()

SkISize SkSize::toCeil ( ) const
inline

Definition at line 83 of file SkSize.h.

#define SkScalarCeilToInt(x)
Definition: SkScalar.h:36

◆ toFloor()

SkISize SkSize::toFloor ( ) const
inline

Definition at line 85 of file SkSize.h.

#define SkScalarFloorToInt(x)
Definition: SkScalar.h:35

◆ toRound()

SkISize SkSize::toRound ( ) const
inline

Definition at line 81 of file SkSize.h.

#define SkScalarRoundToInt(x)
Definition: SkScalar.h:37

◆ width()

SkScalar SkSize::width ( ) const
inline

Definition at line 76 of file SkSize.h.

76{ return fWidth; }

Member Data Documentation

◆ fHeight

SkScalar SkSize::fHeight

Definition at line 54 of file SkSize.h.

◆ fWidth

SkScalar SkSize::fWidth

Definition at line 53 of file SkSize.h.


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