32 return 0 == fWidth && 0 == fHeight;
37 return fWidth <= 0 || fHeight <= 0;
45 T width()
const {
return fWidth; }
46 T height()
const {
return fHeight; }
58 bool equals(T w, T h)
const {
59 return fWidth == w && fHeight == h;
65 return a.fWidth == b.fWidth && a.fHeight == b.fHeight;
78 static SkSize Make(SkScalar w, SkScalar h) {
87 this->set(SkIntToScalar(src.fWidth), SkIntToScalar(src.fHeight));
93 s.set(SkScalarRoundToInt(fWidth), SkScalarRoundToInt(fHeight));
99 s.set(SkScalarCeilToInt(fWidth), SkScalarCeilToInt(fHeight));
105 s.set(SkScalarFloorToInt(fWidth), SkScalarFloorToInt(fHeight));
bool isEmpty() const
Returns true if either widht or height are <= 0.
Definition: SkSize.h:36
void clampNegToZero()
If width or height is < 0, it is set to 0.
Definition: SkSize.h:49
bool isZero() const
Returns true iff fWidth == 0 && fHeight == 0.
Definition: SkSize.h:31
void setEmpty()
Set the width and height to 0.
Definition: SkSize.h:41