Bug 1561235. Check the type of the PathBuilder instead of the DrawTarget. r=mstange

The draw target might give us a different type.

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Jeff Muizelaar 2019-07-03 20:13:44 +00:00
Родитель 02f77cdcee
Коммит ca49b31c2a
1 изменённых файлов: 5 добавлений и 4 удалений

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

@ -149,13 +149,14 @@ ScaledFontDWrite::ScaledFontDWrite(IDWriteFontFace* aFontFace,
already_AddRefed<Path> ScaledFontDWrite::GetPathForGlyphs(
const GlyphBuffer& aBuffer, const DrawTarget* aTarget) {
if (aTarget->GetBackendType() != BackendType::DIRECT2D &&
aTarget->GetBackendType() != BackendType::DIRECT2D1_1) {
return ScaledFontBase::GetPathForGlyphs(aBuffer, aTarget);
}
RefPtr<PathBuilder> pathBuilder = aTarget->CreatePathBuilder();
if (pathBuilder->GetBackendType() != BackendType::DIRECT2D &&
pathBuilder->GetBackendType() != BackendType::DIRECT2D1_1) {
return ScaledFontBase::GetPathForGlyphs(aBuffer, aTarget);
}
PathBuilderD2D* pathBuilderD2D =
static_cast<PathBuilderD2D*>(pathBuilder.get());