Bug 1381973 - Lazily create the reference DT in DrawTargetCapture. r=dvander

This commit is contained in:
Mason Chang
2017-07-26 15:43:00 -07:00
parent 744e0e5c41
commit 178af9710d
8 changed files with 61 additions and 36 deletions

View File

@@ -5119,8 +5119,11 @@ nsDisplayText::nsDisplayText(nsDisplayListBuilder* aBuilder, nsTextFrame* aFrame
if (gfxPrefs::LayersAllowTextLayers() &&
CanUseAdvancedLayer(aBuilder->GetWidgetLayerManager())) {
RefPtr<DrawTarget> screenTarget = gfxPlatform::GetPlatform()->ScreenReferenceDrawTarget();
RefPtr<DrawTargetCapture> capture =
gfxPlatform::GetPlatform()->ScreenReferenceDrawTarget()->CreateCaptureDT(IntSize());
Factory::CreateCaptureDrawTarget(screenTarget->GetBackendType(),
IntSize(),
screenTarget->GetFormat());
RefPtr<gfxContext> captureCtx = gfxContext::CreateOrNull(capture);
// TODO: Paint() checks mDisableSubpixelAA, we should too.