Helper class for constructing SkTextBlobs.
More...
#include <SkTextBlob.h>
|
sk_sp< SkTextBlob > | make () |
| Returns an immutable SkTextBlob for the current runs/glyphs, or nullptr if no runs were allocated. More...
|
|
const RunBuffer & | allocRunText (const SkPaint &font, int count, SkScalar x, SkScalar y, int textByteCount, SkString lang, const SkRect *bounds=NULL) |
| Allocates a new default-positioned run and returns its writable glyph buffer for direct manipulation. More...
|
|
const RunBuffer & | allocRun (const SkPaint &font, int count, SkScalar x, SkScalar y, const SkRect *bounds=NULL) |
|
const RunBuffer & | allocRunTextPosH (const SkPaint &font, int count, SkScalar y, int textByteCount, SkString lang, const SkRect *bounds=NULL) |
| Allocates a new horizontally-positioned run and returns its writable glyph and position buffers for direct manipulation. More...
|
|
const RunBuffer & | allocRunPosH (const SkPaint &font, int count, SkScalar y, const SkRect *bounds=NULL) |
|
const RunBuffer & | allocRunTextPos (const SkPaint &font, int count, int textByteCount, SkString lang, const SkRect *bounds=NULL) |
| Allocates a new fully-positioned run and returns its writable glyph and position buffers for direct manipulation. More...
|
|
const RunBuffer & | allocRunPos (const SkPaint &font, int count, const SkRect *bounds=NULL) |
|
|
void | reserve (size_t size) |
|
void | allocInternal (const SkPaint &font, SkTextBlob::GlyphPositioning positioning, int count, int textBytes, SkPoint offset, const SkRect *bounds) |
|
bool | mergeRun (const SkPaint &font, SkTextBlob::GlyphPositioning positioning, int count, SkPoint offset) |
|
void | updateDeferredBounds () |
|
|
static SkRect | ConservativeRunBounds (const SkTextBlob::RunRecord &) |
|
static SkRect | TightRunBounds (const SkTextBlob::RunRecord &) |
|
|
SkAutoTMalloc< uint8_t > | fStorage |
|
size_t | fStorageSize |
|
size_t | fStorageUsed |
|
SkRect | fBounds |
|
int | fRunCount |
|
bool | fDeferredBounds |
|
size_t | fLastRun |
|
RunBuffer | fCurrentRunBuffer |
|
Helper class for constructing SkTextBlobs.
const RunBuffer& SkTextBlobBuilder::allocRunText |
( |
const SkPaint & |
font, |
|
|
int |
count, |
|
|
SkScalar |
x, |
|
|
SkScalar |
y, |
|
|
int |
textByteCount, |
|
|
SkString |
lang, |
|
|
const SkRect * |
bounds = NULL |
|
) |
| |
Allocates a new default-positioned run and returns its writable glyph buffer for direct manipulation.
- Parameters
-
font | The font to be used for this run. |
count | Number of glyphs. |
x,y | Position within the blob. |
textByteCount | length of the original UTF-8 text that corresponds to this sequence of glyphs. If 0, text will not be included in the textblob. |
lang | Language code, currently unimplemented. |
bounds | Optional run bounding box. If known in advance (!= NULL), it will be used when computing the blob bounds, to avoid re-measuring. |
- Returns
- A writable glyph buffer, valid until the next allocRun() or build() call. The buffer is guaranteed to hold @ glyphs.
const RunBuffer& SkTextBlobBuilder::allocRunTextPos |
( |
const SkPaint & |
font, |
|
|
int |
count, |
|
|
int |
textByteCount, |
|
|
SkString |
lang, |
|
|
const SkRect * |
bounds = NULL |
|
) |
| |
Allocates a new fully-positioned run and returns its writable glyph and position buffers for direct manipulation.
- Parameters
-
font | The font to be used for this run. |
count | Number of glyphs. |
textByteCount | length of the original UTF-8 text that corresponds to this sequence of glyphs. If 0, text will not be included in the textblob. |
lang | Language code, currently unimplemented. |
bounds | Optional run bounding box. If known in advance (!= NULL), it will be used when computing the blob bounds, to avoid re-measuring. |
- Returns
- Writable glyph and position buffers, valid until the next allocRun() or build() call. The glyph buffer and position buffer are guaranteed to hold @ and 2 * @ elements, respectively.
const RunBuffer& SkTextBlobBuilder::allocRunTextPosH |
( |
const SkPaint & |
font, |
|
|
int |
count, |
|
|
SkScalar |
y, |
|
|
int |
textByteCount, |
|
|
SkString |
lang, |
|
|
const SkRect * |
bounds = NULL |
|
) |
| |
Allocates a new horizontally-positioned run and returns its writable glyph and position buffers for direct manipulation.
- Parameters
-
font | The font to be used for this run. |
count | Number of glyphs. |
y | Vertical offset within the blob. |
textByteCount | length of the original UTF-8 text that corresponds to this sequence of glyphs. If 0, text will not be included in the textblob. |
lang | Language code, currently unimplemented. |
bounds | Optional run bounding box. If known in advance (!= NULL), it will be used when computing the blob bounds, to avoid re-measuring. |
- Returns
- Writable glyph and position buffers, valid until the next allocRun() or build() call. The buffers are guaranteed to hold @ elements.
Returns an immutable SkTextBlob for the current runs/glyphs, or nullptr if no runs were allocated.
The builder is reset and can be reused.
The documentation for this class was generated from the following file: