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 249 of file SkScalerContext.h.
anonymous enum |
Definition at line 251 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 1236 of file SkScalerContext.cpp.
|
static |
Definition at line 1265 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 969 of file SkScalerContext.cpp.
|
static |
Definition at line 1195 of file SkScalerContext.cpp.
|
static |
Definition at line 1261 of file SkScalerContext.cpp.
|
static |
Definition at line 1249 of file SkScalerContext.cpp.
|
inlineprotected |
Definition at line 441 of file SkScalerContext.h.
|
inlineprotected |
Definition at line 442 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 744 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 490 of file SkScalerContext.cpp.
|
protectedpure virtual |
|
staticprotected |
Definition at line 218 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 740 of file SkScalerContext.cpp.
|
inline |
Definition at line 362 of file SkScalerContext.h.
void SkScalerContext::getFontMetrics | ( | SkFontMetrics * | fm | ) |
Definition at line 748 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 175 of file SkScalerContext.cpp.
|
static |
Return the size in bytes of the associated gamma lookup table
Definition at line 162 of file SkScalerContext.cpp.
void SkScalerContext::getImage | ( | const SkGlyph & | origGlyph | ) |
Definition at line 586 of file SkScalerContext.cpp.
|
inline |
Definition at line 289 of file SkScalerContext.h.
|
static |
Expands fDeviceGamma, fPaintGamma, fContrast, and fLumBits into a mask pre-blend.
Definition at line 151 of file SkScalerContext.cpp.
void SkScalerContext::getPath | ( | SkGlyph & | glyph, |
SkArenaAlloc * | alloc | ||
) |
Definition at line 736 of file SkScalerContext.cpp.
|
inline |
Definition at line 360 of file SkScalerContext.h.
|
inline |
Definition at line 287 of file SkScalerContext.h.
|
inline |
Definition at line 297 of file SkScalerContext.h.
|
inline |
Definition at line 293 of file SkScalerContext.h.
|
inline |
Definition at line 302 of file SkScalerContext.h.
|
static |
Definition at line 1272 of file SkScalerContext.cpp.
SkGlyph SkScalerContext::makeGlyph | ( | SkPackedGlyphID | packedID, |
SkArenaAlloc * | alloc | ||
) |
Definition at line 193 of file SkScalerContext.cpp.
|
static |
Definition at line 1045 of file SkScalerContext.cpp.
|
inlinestatic |
Definition at line 331 of file SkScalerContext.h.
Definition at line 211 of file SkScalerContext.cpp.
Definition at line 204 of file SkScalerContext.cpp.
|
friend |
Definition at line 445 of file SkScalerContext.h.
|
friend |
Definition at line 446 of file SkScalerContext.h.
|
friend |
Definition at line 447 of file SkScalerContext.h.
|
protected |
Definition at line 470 of file SkScalerContext.h.
|
protected |
Definition at line 379 of file SkScalerContext.h.