Bug 1375179. Don't create a DrawTrargetDual from DrawTargetDual::CreateSimilarSurface() r=mstange

We mostly don't want a DrawTargetDual when calling CreateSimilarSurface
because we're going to doing something with that surface that doesn't
preserve the subpixel rendering.
This commit is contained in:
Jeff Muizelaar 2017-06-22 10:18:33 -04:00
Родитель 8d489930b6
Коммит e61bc0e9d7
1 изменённых файлов: 3 добавлений и 9 удалений

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

@ -208,15 +208,9 @@ DrawTargetDual::PushLayer(bool aOpaque, Float aOpacity, SourceSurface* aMask,
already_AddRefed<DrawTarget>
DrawTargetDual::CreateSimilarDrawTarget(const IntSize &aSize, SurfaceFormat aFormat) const
{
RefPtr<DrawTarget> dtA = mA->CreateSimilarDrawTarget(aSize, aFormat);
RefPtr<DrawTarget> dtB = mB->CreateSimilarDrawTarget(aSize, aFormat);
if (!dtA || !dtB) {
gfxWarning() << "Failure to allocate a similar DrawTargetDual. Size: " << aSize;
return nullptr;
}
return MakeAndAddRef<DrawTargetDual>(dtA, dtB);
/* Now that we have PushLayer there a very few cases where a user of DrawTargetDual
* wants to have a DualTarget when creating a similar one. */
return mA->CreateSimilarDrawTarget(aSize, aFormat);
}
} // namespace gfx