From 377f3f30b22b0a8ca9012258b60ba7d872d5ea51 Mon Sep 17 00:00:00 2001 From: Bob Owen Date: Sat, 8 Apr 2017 22:47:51 +0100 Subject: [PATCH] Bug 1347646 Part 2: Use CreateRenderingContext in nsSimplePageSequenceFrame::PrePrintNextPage to ensure recorder is used for canvases. r=jwatt Calling CreateReferenceRenderingContext currently returns a non-recording DrawTarget even when the nsIDeviceContextSpec within the nsDeviceContext has a DrawEventRecorder, due to bug 1354624. Since we've already called BeginPage we can call CreateRenderingContext instead though and that will give us a recording DrawTarget as we require to record the canvas drawing. --- layout/generic/nsSimplePageSequenceFrame.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layout/generic/nsSimplePageSequenceFrame.cpp b/layout/generic/nsSimplePageSequenceFrame.cpp index eca57d9c780a..fdfcfe758652 100644 --- a/layout/generic/nsSimplePageSequenceFrame.cpp +++ b/layout/generic/nsSimplePageSequenceFrame.cpp @@ -629,7 +629,7 @@ nsSimplePageSequenceFrame::PrePrintNextPage(nsITimerCallback* aCallback, bool* a mCalledBeginPage = true; - RefPtr renderingContext = dc->CreateReferenceRenderingContext(); + RefPtr renderingContext = dc->CreateRenderingContext(); NS_ENSURE_TRUE(renderingContext, NS_ERROR_OUT_OF_MEMORY); DrawTarget* drawTarget = renderingContext->GetDrawTarget();