mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 895078. Implement ScaledFontMac::CopyGlyphsToBuilder. r=mattwoodrow
--HG-- extra : rebase_source : e18c584de856676b84c9aac50021f255185a677a
This commit is contained in:
parent
8566657ec1
commit
390cefe9d9
@ -48,6 +48,7 @@ public:
|
||||
|
||||
private:
|
||||
friend class PathCG;
|
||||
friend class ScaledFontMac;
|
||||
|
||||
void EnsureActive(const Point &aPoint);
|
||||
|
||||
|
@ -101,5 +101,25 @@ ScaledFontMac::GetPathForGlyphs(const GlyphBuffer &aBuffer, const DrawTarget *aT
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
ScaledFontMac::CopyGlyphsToBuilder(const GlyphBuffer &aBuffer, PathBuilder *aBuilder)
|
||||
{
|
||||
PathBuilderCG *pathBuilderCG =
|
||||
static_cast<PathBuilderCG*>(aBuilder);
|
||||
// XXX: check builder type
|
||||
for (unsigned int i = 0; i < aBuffer.mNumGlyphs; i++) {
|
||||
// XXX: we could probably fold both of these transforms together to avoid extra work
|
||||
CGAffineTransform flip = CGAffineTransformMakeScale(1, -1);
|
||||
CGPathRef glyphPath = ::CGFontGetGlyphPath(mFont, &flip, 0, aBuffer.mGlyphs[i].mIndex);
|
||||
|
||||
CGAffineTransform matrix = CGAffineTransformMake(mSize, 0, 0, mSize,
|
||||
aBuffer.mGlyphs[i].mPosition.x,
|
||||
aBuffer.mGlyphs[i].mPosition.y);
|
||||
CGPathAddPath(pathBuilderCG->mCGPath, &matrix, glyphPath);
|
||||
CGPathRelease(glyphPath);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -25,6 +25,7 @@ public:
|
||||
virtual SkTypeface* GetSkTypeface();
|
||||
#endif
|
||||
virtual TemporaryRef<Path> GetPathForGlyphs(const GlyphBuffer &aBuffer, const DrawTarget *aTarget);
|
||||
virtual void CopyGlyphsToBuilder(const GlyphBuffer &aBuffer, PathBuilder *aBuilder);
|
||||
|
||||
private:
|
||||
friend class DrawTargetCG;
|
||||
|
Loading…
Reference in New Issue
Block a user