Commit 00a1fc83 authored by fmalita@chromium.org's avatar fmalita@chromium.org

[TextBlob] Plumb a Font param for setupPaint().

Similarly to the non-blob code path, we should pass a Font arg to
setupPaint() for Mac hinting heuristics.

(See https://codereview.chromium.org/692643006)

BUG=421412
R=eae@chromium.org,jbroman@chromium.org,bungeman@chromium.org

Review URL: https://codereview.chromium.org/692643007

git-svn-id: svn://svn.chromium.org/blink/trunk@185082 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent c1a2aeaf
......@@ -263,7 +263,7 @@ namespace {
template <bool hasOffsets>
bool buildTextBlobInternal(const GlyphBuffer& glyphBuffer, SkScalar initialAdvance,
const SkRect* bounds, bool couldUseLCD, SkTextBlobBuilder& builder)
const SkRect* bounds, bool couldUseLCD, SkTextBlobBuilder& builder, const Font& font)
{
SkScalar x = initialAdvance;
unsigned i = 0;
......@@ -278,7 +278,7 @@ bool buildTextBlobInternal(const GlyphBuffer& glyphBuffer, SkScalar initialAdvan
// factor, which is found via the GraphicsContext. This should be fixed
// to avoid correctness problems here.
SkPaint paint;
fontData->platformData().setupPaint(&paint);
fontData->platformData().setupPaint(&paint, 0, &font);
paint.setTextEncoding(SkPaint::kGlyphID_TextEncoding);
// FIXME: this should go away after the big LCD cleanup.
......@@ -324,8 +324,8 @@ PassTextBlobPtr Font::buildTextBlob(const GlyphBuffer& glyphBuffer, float initia
SkRect skBounds = bounds;
bool success = glyphBuffer.hasOffsets() ?
buildTextBlobInternal<true>(glyphBuffer, advance, &skBounds, couldUseLCD, builder) :
buildTextBlobInternal<false>(glyphBuffer, advance, &skBounds, couldUseLCD, builder);
buildTextBlobInternal<true>(glyphBuffer, advance, &skBounds, couldUseLCD, builder, *this) :
buildTextBlobInternal<false>(glyphBuffer, advance, &skBounds, couldUseLCD, builder, *this);
return success ? adoptRef(builder.build()) : nullptr;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment