26 : fAutoDescriptor{descriptor}
27 , fTypeface{
std::move(typeface)} {}
47 sourceFont.setSubpixel(
false);
48 return SkStrikeSpec(sourceFont,
paint, surfaceProps, scalerContextFlags, deviceMatrix);
61 pathFont.setSubpixel(
false);
65 SkScalar strikeToSourceScale = pathFont.setupForAsPaths(&pathPaint);
74 if (
paint !=
nullptr) {
75 canonicalizedPaint = *
paint;
78 const SkFont* canonicalizedFont = &font;
82 canonicalizedFont = pathFont.
set(font);
83 strikeToSourceScale = pathFont->setupForAsPaths(
nullptr);
84 canonicalizedPaint.
reset();
94 if (
paint !=
nullptr) {
119 constexpr SkScalar memoryLimit = 256;
120 constexpr SkScalar maxSizeSquared = memoryLimit * memoryLimit;
122 auto distance = [&textMatrix](
int XIndex,
int YIndex) {
123 return textMatrix[XIndex] * textMatrix[XIndex] + textMatrix[YIndex] * textMatrix[YIndex];
140 if (unitsPerEm <= 0) {
162 font,
paint, surfaceProps, scalerContextFlags, deviceMatrix,
163 &fAutoDescriptor, &effects);
167 fTypeface = font.refTypeface();
172 return cache->findOrCreateScopedStrike(*
this);
182 return cache->findOrCreateStrike(*
this);
186 : fStrike{spec.findOrCreateStrike()} { }
192 return fStrike->
metrics(glyphIDs, fGlyphs.
get());
200 : fStrike{spec.findOrCreateStrike()} { }
203 : fStrike{
std::move(strike)} { }
225 : fStrike{spec.findOrCreateStrike()} { }
228 : fStrike{
std::move(strike)} { }
242 : fStrike{spec.findOrCreateStrike()} { }
245 : fStrike{
std::move(strike)} { }
@ kNone
glyph outlines unchanged
sk_sp< T > sk_ref_sp(T *obj)
@ kFakeGammaAndBoostContrast
SkDescriptor * getDesc() const
SkSpan< const SkGlyph * > glyphs(SkSpan< const SkGlyphID > glyphIDs)
~SkBulkGlyphMetricsAndDrawables()
SkBulkGlyphMetricsAndDrawables(const SkStrikeSpec &spec)
const SkGlyph * glyph(SkGlyphID glyphID)
const SkDescriptor & descriptor() const
SkSpan< const SkGlyph * > glyphs(SkSpan< const SkPackedGlyphID > packedIDs)
SkBulkGlyphMetricsAndImages(const SkStrikeSpec &spec)
const SkGlyph * glyph(SkPackedGlyphID packedID)
~SkBulkGlyphMetricsAndImages()
SkBulkGlyphMetricsAndPaths(const SkStrikeSpec &spec)
~SkBulkGlyphMetricsAndPaths()
SkSpan< const SkGlyph * > glyphs(SkSpan< const SkGlyphID > glyphIDs)
void findIntercepts(const SkScalar bounds[2], SkScalar scale, SkScalar xPos, const SkGlyph *glyph, SkScalar *array, int *count)
const SkGlyph * glyph(SkGlyphID glyphID)
SkBulkGlyphMetrics(const SkStrikeSpec &spec)
SkSpan< const SkGlyph * > glyphs(SkSpan< const SkGlyphID > glyphIDs)
const SkGlyph * glyph(SkGlyphID glyphID)
static SkMatrix MakeTextMatrix(SkScalar size, SkScalar scaleX, SkScalar skewX)
@ kAlias
no transparent pixels on glyph edges
static constexpr int kMScaleX
horizontal scale factor
SkMatrix & postConcat(const SkMatrix &other)
static const SkMatrix & I()
bool hasPerspective() const
static constexpr int kMSkewY
vertical skew factor
static constexpr int kMScaleY
vertical scale factor
static constexpr int kMSkewX
horizontal skew factor
@ kStroke_Style
set to stroke geometry
static SkDescriptor * CreateDescriptorAndEffectsUsingPaint(const SkFont &, const SkPaint &, const SkSurfaceProps &, SkScalerContextFlags scalerContextFlags, const SkMatrix &deviceMatrix, SkAutoDescriptor *ad, SkScalerContextEffects *effects)
constexpr size_t size() const
sk_sp< SkStrike > findOrCreateStrike(const SkStrikeSpec &strikeSpec) SK_EXCLUDES(fLock)
static SkStrikeCache * GlobalStrikeCache()
sk_sp< sktext::StrikeForGPU > findOrCreateScopedStrike(sktext::StrikeForGPUCacheInterface *cache) const
static SkStrikeSpec MakeTransformMask(const SkFont &font, const SkPaint &paint, const SkSurfaceProps &surfaceProps, SkScalerContextFlags scalerContextFlags, const SkMatrix &deviceMatrix)
static SkStrikeSpec MakeMask(const SkFont &font, const SkPaint &paint, const SkSurfaceProps &surfaceProps, SkScalerContextFlags scalerContextFlags, const SkMatrix &deviceMatrix)
static SkStrikeSpec MakeWithNoDevice(const SkFont &font, const SkPaint *paint=nullptr)
const SkTypeface & typeface() const
static bool ShouldDrawAsPath(const SkPaint &paint, const SkFont &font, const SkMatrix &matrix)
sk_sp< SkStrike > findOrCreateStrike() const
static std::tuple< SkStrikeSpec, SkScalar > MakeCanonicalized(const SkFont &font, const SkPaint *paint=nullptr)
static SkStrikeSpec MakePDFVector(const SkTypeface &typeface, int *size)
static std::tuple< SkStrikeSpec, SkScalar > MakePath(const SkFont &font, const SkPaint &paint, const SkSurfaceProps &surfaceProps, SkScalerContextFlags scalerContextFlags)
SkStrikeSpec(const SkDescriptor &descriptor, sk_sp< SkTypeface > typeface)
const SkDescriptor & getDescriptor() const override
SkSpan< const SkGlyph * > metrics(SkSpan< const SkGlyphID > glyphIDs, const SkGlyph *results[]) SK_EXCLUDES(fStrikeLock)
SkSpan< const SkGlyph * > preparePaths(SkSpan< const SkGlyphID > glyphIDs, const SkGlyph *results[]) SK_EXCLUDES(fStrikeLock)
void findIntercepts(const SkScalar bounds[2], SkScalar scale, SkScalar xPos, SkGlyph *, SkScalar *array, int *count) SK_EXCLUDES(fStrikeLock)
SkSpan< const SkGlyph * > prepareDrawables(SkSpan< const SkGlyphID > glyphIDs, const SkGlyph *results[]) SK_EXCLUDES(fStrikeLock)
SkSpan< const SkGlyph * > prepareImages(SkSpan< const SkPackedGlyphID > glyphIDs, const SkGlyph *results[]) SK_EXCLUDES(fStrikeLock)
int getUnitsPerEm() const
SkPathEffect * fPathEffect
SkMaskFilter * fMaskFilter