Flutter Engine
The Flutter Engine
Public Member Functions | Friends | List of all members
SkGlyphRect Class Reference

#include <SkGlyph.h>

Public Member Functions

 SkGlyphRect ()=default
 
 SkGlyphRect (SkScalar left, SkScalar top, SkScalar right, SkScalar bottom)
 
bool empty () const
 
SkRect rect () const
 
SkGlyphRect offset (SkScalar x, SkScalar y) const
 
SkGlyphRect offset (SkPoint pt) const
 
SkGlyphRect scaleAndOffset (SkScalar scale, SkPoint offset) const
 
SkGlyphRect inset (SkScalar dx, SkScalar dy) const
 
SkPoint leftTop () const
 
SkPoint rightBottom () const
 
SkPoint widthHeight () const
 

Friends

SkGlyphRect skglyph::rect_union (SkGlyphRect, SkGlyphRect)
 
SkGlyphRect skglyph::rect_intersection (SkGlyphRect, SkGlyphRect)
 

Detailed Description

Definition at line 251 of file SkGlyph.h.

Constructor & Destructor Documentation

◆ SkGlyphRect() [1/2]

SkGlyphRect::SkGlyphRect ( )
default

◆ SkGlyphRect() [2/2]

SkGlyphRect::SkGlyphRect ( SkScalar  left,
SkScalar  top,
SkScalar  right,
SkScalar  bottom 
)
inline

Definition at line 254 of file SkGlyph.h.

255 : fRect{-left, -top, right, bottom} { }
static bool left(const SkPoint &p0, const SkPoint &p1)
static bool right(const SkPoint &p0, const SkPoint &p1)

Member Function Documentation

◆ empty()

bool SkGlyphRect::empty ( ) const
inline

Definition at line 256 of file SkGlyph.h.

256 {
257 return -fRect[0] >= fRect[2] || -fRect[1] >= fRect[3];
258 }

◆ inset()

SkGlyphRect SkGlyphRect::inset ( SkScalar  dx,
SkScalar  dy 
) const
inline

Definition at line 272 of file SkGlyph.h.

272 {
273 return fRect - Storage{dx, dy, dx, dy};
274 }
skia_private::AutoTArray< sk_sp< SkImageFilter > > filters TypedMatrix matrix TypedMatrix matrix SkScalar dx
Definition: SkRecords.h:208

◆ leftTop()

SkPoint SkGlyphRect::leftTop ( ) const
inline

Definition at line 275 of file SkGlyph.h.

275{ return -this->negLeftTop(); }

◆ offset() [1/2]

SkGlyphRect SkGlyphRect::offset ( SkPoint  pt) const
inline

Definition at line 265 of file SkGlyph.h.

265 {
266 return this->offset(pt.x(), pt.y());
267 }
SkGlyphRect offset(SkScalar x, SkScalar y) const
Definition: SkGlyph.h:262
constexpr float y() const
Definition: SkPoint_impl.h:187
constexpr float x() const
Definition: SkPoint_impl.h:181

◆ offset() [2/2]

SkGlyphRect SkGlyphRect::offset ( SkScalar  x,
SkScalar  y 
) const
inline

Definition at line 262 of file SkGlyph.h.

262 {
263 return SkGlyphRect{fRect + Storage{-x, -y, x, y}};
264 }
double y
double x

◆ rect()

SkRect SkGlyphRect::rect ( ) const
inline

Definition at line 259 of file SkGlyph.h.

259 {
260 return SkRect::MakeLTRB(-fRect[0], -fRect[1], fRect[2], fRect[3]);
261 }
static constexpr SkRect MakeLTRB(float l, float t, float r, float b)
Definition: SkRect.h:646

◆ rightBottom()

SkPoint SkGlyphRect::rightBottom ( ) const
inline

Definition at line 276 of file SkGlyph.h.

276{ return {fRect[2], fRect[3]}; }

◆ scaleAndOffset()

SkGlyphRect SkGlyphRect::scaleAndOffset ( SkScalar  scale,
SkPoint  offset 
) const
inline

Definition at line 268 of file SkGlyph.h.

268 {
269 auto [x, y] = offset;
270 return fRect * scale + Storage{-x, -y, x, y};
271 }
const Scalar scale

◆ widthHeight()

SkPoint SkGlyphRect::widthHeight ( ) const
inline

Definition at line 277 of file SkGlyph.h.

277{ return this->rightBottom() + negLeftTop(); }
SkPoint rightBottom() const
Definition: SkGlyph.h:276

Friends And Related Function Documentation

◆ skglyph::rect_intersection

◆ skglyph::rect_union


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