Bug 1598063 - Don't hide text styled with a pending user font when drawing canvas text, just draw with fallback instead. r=heycam

Differential Revision: https://phabricator.services.mozilla.com/D55707

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Jonathan Kew 2019-12-03 21:14:52 +00:00
Родитель a7aa37a16f
Коммит 1598ebe8a8
3 изменённых файлов: 12 добавлений и 5 удалений

Просмотреть файл

@ -3493,9 +3493,10 @@ struct MOZ_STACK_CLASS CanvasBidiProcessor
} else { } else {
flags &= ~gfx::ShapedTextFlags::TEXT_IS_RTL; flags &= ~gfx::ShapedTextFlags::TEXT_IS_RTL;
} }
mTextRun = mTextRun = mFontgrp->MakeTextRun(
mFontgrp->MakeTextRun(aText, aLength, mDrawTarget, mAppUnitsPerDevPixel, aText, aLength, mDrawTarget, mAppUnitsPerDevPixel, flags,
flags, nsTextFrameUtils::Flags(), mMissingFonts); nsTextFrameUtils::Flags::DontSkipDrawingForPendingUserFonts,
mMissingFonts);
} }
virtual nscoord GetWidth() override { virtual nscoord GetWidth() override {

Просмотреть файл

@ -183,7 +183,9 @@ gfxTextRun::gfxTextRun(const gfxTextRunFactory::Parameters* aParams,
AccountStorageForTextRun(this, 1); AccountStorageForTextRun(this, 1);
#endif #endif
mSkipDrawing = mFontGroup->ShouldSkipDrawing(); mSkipDrawing =
mFontGroup->ShouldSkipDrawing() &&
!(aFlags2 & nsTextFrameUtils::Flags::DontSkipDrawingForPendingUserFonts);
} }
gfxTextRun::~gfxTextRun() { gfxTextRun::~gfxTextRun() {

Просмотреть файл

@ -35,7 +35,11 @@ class nsTextFrameUtils {
HasTab = 0x01, HasTab = 0x01,
// the original text has at least one soft hyphen character // the original text has at least one soft hyphen character
HasShy = 0x02, HasShy = 0x02,
UnusedFlags = 0x0C, UnusedFlags = 0x04,
// Flag used in textrun construction to *prevent* hiding of fallback text
// for pending user-fonts (used for Canvas2d text).
DontSkipDrawingForPendingUserFonts = 0x08,
// The following flags are set by nsTextFrame // The following flags are set by nsTextFrame