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

#include <SkTextBlobPriv.h>

Public Types

enum  GlyphPositioning : uint8_t { kDefault_Positioning = 0 , kHorizontal_Positioning = 1 , kFull_Positioning = 2 , kRSXform_Positioning = 3 }
 

Public Member Functions

 SkTextBlobRunIterator (const SkTextBlob *blob)
 
bool done () const
 
void next ()
 
uint32_t glyphCount () const
 
const uint16_t * glyphs () const
 
const SkScalarpos () const
 
const SkPointpoints () const
 
const SkRSXformxforms () const
 
const SkPointoffset () const
 
const SkFontfont () const
 
GlyphPositioning positioning () const
 
unsigned scalarsPerGlyph () const
 
uint32_t * clusters () const
 
uint32_t textSize () const
 
char * text () const
 
bool isLCD () const
 

Detailed Description

Iterate through all of the text runs of the text blob. For example: for (SkTextBlobRunIterator it(blob); !it.done(); it.next()) { ..... }

Definition at line 185 of file SkTextBlobPriv.h.

Member Enumeration Documentation

◆ GlyphPositioning

Enumerator
kDefault_Positioning 
kHorizontal_Positioning 
kFull_Positioning 
kRSXform_Positioning 

Definition at line 189 of file SkTextBlobPriv.h.

189 : uint8_t {
190 kDefault_Positioning = 0, // Default glyph advances -- zero scalars per glyph.
191 kHorizontal_Positioning = 1, // Horizontal positioning -- one scalar per glyph.
192 kFull_Positioning = 2, // Point positioning -- two scalars per glyph.
193 kRSXform_Positioning = 3, // RSXform positioning -- four scalars per glyph.
194 };

Constructor & Destructor Documentation

◆ SkTextBlobRunIterator()

SkTextBlobRunIterator::SkTextBlobRunIterator ( const SkTextBlob blob)

Definition at line 222 of file SkTextBlob.cpp.

223 : fCurrentRun(SkTextBlob::RunRecord::First(blob)) {
224 SkDEBUGCODE(fStorageTop = (const uint8_t*)blob + blob->fStorageSize;)
225}
SkDEBUGCODE(SK_SPI) SkThreadID SkGetThreadID()

Member Function Documentation

◆ clusters()

uint32_t * SkTextBlobRunIterator::clusters ( ) const
inline

Definition at line 231 of file SkTextBlobPriv.h.

231 {
232 SkASSERT(!this->done());
233 return fCurrentRun->clusterBuffer();
234 }
#define SkASSERT(cond)
Definition: SkAssert.h:116

◆ done()

bool SkTextBlobRunIterator::done ( ) const
inline

Definition at line 196 of file SkTextBlobPriv.h.

196 {
197 return !fCurrentRun;
198 }

◆ font()

const SkFont & SkTextBlobRunIterator::font ( ) const
inline

Definition at line 225 of file SkTextBlobPriv.h.

225 {
226 SkASSERT(!this->done());
227 return fCurrentRun->font();
228 }

◆ glyphCount()

uint32_t SkTextBlobRunIterator::glyphCount ( ) const
inline

Definition at line 201 of file SkTextBlobPriv.h.

201 {
202 SkASSERT(!this->done());
203 return fCurrentRun->glyphCount();
204 }

◆ glyphs()

const uint16_t * SkTextBlobRunIterator::glyphs ( ) const
inline

Definition at line 205 of file SkTextBlobPriv.h.

205 {
206 SkASSERT(!this->done());
207 return fCurrentRun->glyphBuffer();
208 }

◆ isLCD()

bool SkTextBlobRunIterator::isLCD ( ) const

Definition at line 254 of file SkTextBlob.cpp.

254 {
255 return fCurrentRun->font().getEdging() == SkFont::Edging::kSubpixelAntiAlias;
256}
@ kSubpixelAntiAlias
glyph positioned in pixel using transparency

◆ next()

void SkTextBlobRunIterator::next ( )

Definition at line 227 of file SkTextBlob.cpp.

227 {
228 SkASSERT(!this->done());
229
230 if (!this->done()) {
231 SkDEBUGCODE(fCurrentRun->validate(fStorageTop);)
232 fCurrentRun = SkTextBlob::RunRecord::Next(fCurrentRun);
233 }
234}

◆ offset()

const SkPoint & SkTextBlobRunIterator::offset ( ) const
inline

Definition at line 221 of file SkTextBlobPriv.h.

221 {
222 SkASSERT(!this->done());
223 return fCurrentRun->offset();
224 }

◆ points()

const SkPoint * SkTextBlobRunIterator::points ( ) const
inline

Definition at line 214 of file SkTextBlobPriv.h.

214 {
215 return fCurrentRun->pointBuffer();
216 }

◆ pos()

const SkScalar * SkTextBlobRunIterator::pos ( ) const
inline

Definition at line 209 of file SkTextBlobPriv.h.

209 {
210 SkASSERT(!this->done());
211 return fCurrentRun->posBuffer();
212 }

◆ positioning()

SkTextBlobRunIterator::GlyphPositioning SkTextBlobRunIterator::positioning ( ) const

Definition at line 236 of file SkTextBlob.cpp.

236 {
237 SkASSERT(!this->done());
238 static_assert(static_cast<GlyphPositioning>(SkTextBlob::kDefault_Positioning) ==
240 static_assert(static_cast<GlyphPositioning>(SkTextBlob::kHorizontal_Positioning) ==
242 static_assert(static_cast<GlyphPositioning>(SkTextBlob::kFull_Positioning) ==
244 static_assert(static_cast<GlyphPositioning>(SkTextBlob::kRSXform_Positioning) ==
246
247 return SkTo<GlyphPositioning>(fCurrentRun->positioning());
248}
@ kHorizontal_Positioning
Definition: SkTextBlob.cpp:194
@ kDefault_Positioning
Definition: SkTextBlob.cpp:193
@ kRSXform_Positioning
Definition: SkTextBlob.cpp:196
@ kFull_Positioning
Definition: SkTextBlob.cpp:195

◆ scalarsPerGlyph()

unsigned SkTextBlobRunIterator::scalarsPerGlyph ( ) const

Definition at line 250 of file SkTextBlob.cpp.

250 {
251 return SkTextBlob::ScalarsPerGlyph(fCurrentRun->positioning());
252}

◆ text()

char * SkTextBlobRunIterator::text ( ) const
inline

Definition at line 239 of file SkTextBlobPriv.h.

239 {
240 SkASSERT(!this->done());
241 return fCurrentRun->textBuffer();
242 }

◆ textSize()

uint32_t SkTextBlobRunIterator::textSize ( ) const
inline

Definition at line 235 of file SkTextBlobPriv.h.

235 {
236 SkASSERT(!this->done());
237 return fCurrentRun->textSize();
238 }

◆ xforms()

const SkRSXform * SkTextBlobRunIterator::xforms ( ) const
inline

Definition at line 218 of file SkTextBlobPriv.h.

218 {
219 return fCurrentRun->xformBuffer();
220 }

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