Flutter Engine
The Flutter Engine
|
#include <SkScalerContext.h>
Classes | |
struct | GlyphMetrics |
Public Types | |
enum | Flags { kFrameAndFill_Flag = 0x0001 , kUnused = 0x0002 , kEmbeddedBitmapText_Flag = 0x0004 , kEmbolden_Flag = 0x0008 , kSubpixelPositioning_Flag = 0x0010 , kForceAutohinting_Flag = 0x0020 , kHinting_Shift = 7 , kHintingBit1_Flag = 0x0080 , kHintingBit2_Flag = 0x0100 , kLCD_Vertical_Flag = 0x0200 , kLCD_BGROrder_Flag = 0x0400 , kGenA8FromLCD_Flag = 0x0800 , kLinearMetrics_Flag = 0x1000 , kBaselineSnap_Flag = 0x2000 , kNeedsForegroundColor_Flag = 0x4000 } |
enum | { kHinting_Mask = kHintingBit1_Flag | kHintingBit2_Flag } |
Public Member Functions | |
SkScalerContext (sk_sp< SkTypeface >, const SkScalerContextEffects &, const SkDescriptor *) | |
virtual | ~SkScalerContext () |
SkTypeface * | getTypeface () const |
SkMask::Format | getMaskFormat () const |
bool | isSubpixel () const |
bool | isLinearMetrics () const |
bool | isVertical () const |
SkGlyph | makeGlyph (SkPackedGlyphID, SkArenaAlloc *) |
void | getImage (const SkGlyph &) |
void | getPath (SkGlyph &, SkArenaAlloc *) |
sk_sp< SkDrawable > | getDrawable (SkGlyph &) |
void | getFontMetrics (SkFontMetrics *) |
const SkScalerContextRec & | getRec () const |
SkScalerContextEffects | getEffects () const |
SkAxisAlignment | computeAxisAlignmentForHText () const |
Protected Member Functions | |
virtual GlyphMetrics | generateMetrics (const SkGlyph &, SkArenaAlloc *)=0 |
virtual void | generateImage (const SkGlyph &glyph, void *imageBuffer)=0 |
virtual bool | generatePath (const SkGlyph &, SkPath *)=0 |
virtual sk_sp< SkDrawable > | generateDrawable (const SkGlyph &) |
virtual void | generateFontMetrics (SkFontMetrics *)=0 |
void | forceGenerateImageFromPath () |
void | forceOffGenerateImageFromPath () |
Static Protected Member Functions | |
static void | GenerateMetricsFromPath (SkGlyph *glyph, const SkPath &path, SkMask::Format format, bool verticalLCD, bool a8FromLCD, bool hairline) |
static void | SaturateGlyphBounds (SkGlyph *glyph, SkRect &&) |
static void | SaturateGlyphBounds (SkGlyph *glyph, SkIRect const &) |
static void | GenerateImageFromPath (SkMaskBuilder &dst, const SkPath &path, const SkMaskGamma::PreBlend &maskPreBlend, bool doBGR, bool verticalLCD, bool a8FromLCD, bool hairline) |
Protected Attributes | |
SkScalerContextRec | fRec |
const SkMaskGamma::PreBlend | fPreBlend |
Friends | |
class | PathText |
class | PathTextBench |
class | RandomScalerContext |
Definition at line 252 of file SkScalerContext.h.
anonymous enum |
Definition at line 254 of file SkScalerContext.h.
SkScalerContext::SkScalerContext | ( | sk_sp< SkTypeface > | typeface, |
const SkScalerContextEffects & | effects, | ||
const SkDescriptor * | desc | ||
) |
Definition at line 88 of file SkScalerContext.cpp.
|
virtual |
Definition at line 107 of file SkScalerContext.cpp.
|
static |
Definition at line 1244 of file SkScalerContext.cpp.
|
static |
Definition at line 1273 of file SkScalerContext.cpp.
SkAxisAlignment SkScalerContext::computeAxisAlignmentForHText | ( | ) | const |
Return the axis (if any) that the baseline for horizontal text should land on. As an example, the identity matrix will return SkAxisAlignment::kX.
Definition at line 977 of file SkScalerContext.cpp.
|
static |
Definition at line 1203 of file SkScalerContext.cpp.
|
static |
Definition at line 1269 of file SkScalerContext.cpp.
|
static |
Definition at line 1257 of file SkScalerContext.cpp.
|
inlineprotected |
Definition at line 443 of file SkScalerContext.h.
|
inlineprotected |
Definition at line 444 of file SkScalerContext.h.
|
protectedvirtual |
Returns the drawable for the glyph (if any).
The generated drawable will be lifetime scoped to the lifetime of this scaler context. This means the drawable may refer to the scaler context and associated font data.
The drawable does not need to be flattenable (e.g. implement getFactory and getTypeName). Any necessary serialization will be done with makePictureSnapshot.
Reimplemented in SkScalerContextProxy, SkScalerContext_FreeType, SkScalerContext_DW, RandomScalerContext, SkFontationsScalerContext, and SkUserScalerContext.
Definition at line 752 of file SkScalerContext.cpp.
|
protectedpure virtual |
Retrieves font metrics.
Implemented in SkScalerContext_FreeType, SkScalerContext_DW, RandomScalerContext, SkScalerContextProxy, SkUserScalerContext, SkTestScalerContext, and SkFontationsScalerContext.
|
protectedpure virtual |
Generates the contents of glyph.fImage. When called, glyph.fImage will be pointing to a pre-allocated, uninitialized region of memory of size glyph.imageSize(). This method may not change glyph.fMaskFormat.
Because glyph.imageSize() will determine the size of fImage, generateMetrics will be called before generateImage.
Implemented in SkScalerContextProxy, SkScalerContext_FreeType, RandomScalerContext, SkTestScalerContext, SkScalerContext_DW, SkFontationsScalerContext, and SkUserScalerContext.
|
staticprotected |
Definition at line 498 of file SkScalerContext.cpp.
|
protectedpure virtual |
|
staticprotected |
Definition at line 226 of file SkScalerContext.cpp.
Sets the passed path to the glyph outline. If this cannot be done the path is set to empty; Does not apply subpixel positioning to the path.
Implemented in SkScalerContext_DW, RandomScalerContext, SkScalerContextProxy, SkScalerContext_FreeType, SkFontationsScalerContext, SkUserScalerContext, and SkTestScalerContext.
sk_sp< SkDrawable > SkScalerContext::getDrawable | ( | SkGlyph & | glyph | ) |
Definition at line 748 of file SkScalerContext.cpp.
|
inline |
Definition at line 364 of file SkScalerContext.h.
void SkScalerContext::getFontMetrics | ( | SkFontMetrics * | fm | ) |
Definition at line 756 of file SkScalerContext.cpp.
|
static |
Get the associated gamma lookup table. The 'data' pointer must point to pre-allocated memory, with size in bytes greater than or equal to the return value of getGammaLUTSize().
If the lookup table hasn't been initialized (e.g., it's linear), this will return false.
Definition at line 184 of file SkScalerContext.cpp.
|
static |
Return the size in bytes of the associated gamma lookup table
Definition at line 171 of file SkScalerContext.cpp.
void SkScalerContext::getImage | ( | const SkGlyph & | origGlyph | ) |
Definition at line 594 of file SkScalerContext.cpp.
|
inline |
Definition at line 292 of file SkScalerContext.h.
|
static |
Expands fDeviceGamma, fContrast, and fLumBits into a mask pre-blend.
Definition at line 162 of file SkScalerContext.cpp.
void SkScalerContext::getPath | ( | SkGlyph & | glyph, |
SkArenaAlloc * | alloc | ||
) |
Definition at line 744 of file SkScalerContext.cpp.
|
inline |
Definition at line 362 of file SkScalerContext.h.
|
inline |
Definition at line 290 of file SkScalerContext.h.
|
inline |
Definition at line 300 of file SkScalerContext.h.
|
inline |
Definition at line 296 of file SkScalerContext.h.
|
inline |
Definition at line 305 of file SkScalerContext.h.
|
static |
Definition at line 1280 of file SkScalerContext.cpp.
SkGlyph SkScalerContext::makeGlyph | ( | SkPackedGlyphID | packedID, |
SkArenaAlloc * | alloc | ||
) |
Definition at line 201 of file SkScalerContext.cpp.
|
static |
Definition at line 1053 of file SkScalerContext.cpp.
|
inlinestatic |
Definition at line 333 of file SkScalerContext.h.
Definition at line 219 of file SkScalerContext.cpp.
Definition at line 212 of file SkScalerContext.cpp.
|
friend |
Definition at line 447 of file SkScalerContext.h.
|
friend |
Definition at line 448 of file SkScalerContext.h.
|
friend |
Definition at line 449 of file SkScalerContext.h.
|
protected |
Definition at line 472 of file SkScalerContext.h.
|
protected |
Definition at line 381 of file SkScalerContext.h.