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

#include <SkPDFGlyphUse.h>

Public Member Functions

 SkPDFGlyphUse ()
 
 SkPDFGlyphUse (SkGlyphID firstNonZero, SkGlyphID lastGlyph)
 
 ~SkPDFGlyphUse ()=default
 
 SkPDFGlyphUse (SkPDFGlyphUse &&)=default
 
SkPDFGlyphUseoperator= (SkPDFGlyphUse &&)=default
 
SkGlyphID firstNonZero () const
 
SkGlyphID lastGlyph () const
 
void set (SkGlyphID gid)
 
bool has (SkGlyphID gid) const
 
template<typename FN >
void getSetValues (FN f) const
 

Detailed Description

Definition at line 9 of file SkPDFGlyphUse.h.

Constructor & Destructor Documentation

◆ SkPDFGlyphUse() [1/3]

SkPDFGlyphUse::SkPDFGlyphUse ( )
inline

Definition at line 11 of file SkPDFGlyphUse.h.

11: fBitSet(0) {}

◆ SkPDFGlyphUse() [2/3]

SkPDFGlyphUse::SkPDFGlyphUse ( SkGlyphID  firstNonZero,
SkGlyphID  lastGlyph 
)
inline

Definition at line 12 of file SkPDFGlyphUse.h.

13 : fBitSet(lastGlyph - firstNonZero + 2)
14 , fFirstNonZero(firstNonZero)
15 , fLastGlyph(lastGlyph) { SkASSERT(firstNonZero >= 1); }
#define SkASSERT(cond)
Definition: SkAssert.h:116
SkGlyphID lastGlyph() const
Definition: SkPDFGlyphUse.h:21
SkGlyphID firstNonZero() const
Definition: SkPDFGlyphUse.h:20

◆ ~SkPDFGlyphUse()

SkPDFGlyphUse::~SkPDFGlyphUse ( )
default

◆ SkPDFGlyphUse() [3/3]

SkPDFGlyphUse::SkPDFGlyphUse ( SkPDFGlyphUse &&  )
default

Member Function Documentation

◆ firstNonZero()

SkGlyphID SkPDFGlyphUse::firstNonZero ( ) const
inline

Definition at line 20 of file SkPDFGlyphUse.h.

20{ return fFirstNonZero; }

◆ getSetValues()

template<typename FN >
void SkPDFGlyphUse::getSetValues ( FN  f) const
inline

Definition at line 26 of file SkPDFGlyphUse.h.

26 {
27 if (fFirstNonZero == 1) {
28 return fBitSet.forEachSetIndex(std::move(f));
29 }
30 uint16_t offset = fFirstNonZero - 1;
31 fBitSet.forEachSetIndex([&f, offset](unsigned v) { f(v == 0 ? v : v + offset); });
32 }
void forEachSetIndex(FN f) const
Definition: SkBitSet.h:77
SeparatedVector2 offset

◆ has()

bool SkPDFGlyphUse::has ( SkGlyphID  gid) const
inline

Definition at line 23 of file SkPDFGlyphUse.h.

23{ return fBitSet.test(this->toCode(gid)); }
bool test(size_t index) const
Definition: SkBitSet.h:66

◆ lastGlyph()

SkGlyphID SkPDFGlyphUse::lastGlyph ( ) const
inline

Definition at line 21 of file SkPDFGlyphUse.h.

21{ return fLastGlyph; }

◆ operator=()

SkPDFGlyphUse & SkPDFGlyphUse::operator= ( SkPDFGlyphUse &&  )
default

◆ set()

void SkPDFGlyphUse::set ( SkGlyphID  gid)
inline

Definition at line 22 of file SkPDFGlyphUse.h.

22{ fBitSet.set(this->toCode(gid)); }
void set(size_t index)
Definition: SkBitSet.h:41

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