Bug 1347646 Part 2: Use CreateRenderingContext in nsSimplePageSequenceFrame::PrePrintNextPage to ensure recorder is used for canvases. r=jwatt a=lizzard
authorBob Owen <bobowencode@gmail.com>
Sat, 08 Apr 2017 22:47:51 +0100
changeset 379505 6e672a99997a34a5c8442f75aebaa68322e01675
parent 379504 9a2a544057ec137d27555a261e790c6ae1945acf
child 379506 7bdd4de249234301ea3a9b70b0349af3bd23b70b
push id1419
push userjlund@mozilla.com
push dateMon, 10 Apr 2017 20:44:07 +0000
treeherdermozilla-release@5e6801b73ef6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjwatt, lizzard
bugs1347646, 1354624
milestone53.0
Bug 1347646 Part 2: Use CreateRenderingContext in nsSimplePageSequenceFrame::PrePrintNextPage to ensure recorder is used for canvases. r=jwatt a=lizzard 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
--- a/layout/generic/nsSimplePageSequenceFrame.cpp
+++ b/layout/generic/nsSimplePageSequenceFrame.cpp
@@ -612,17 +612,17 @@ nsSimplePageSequenceFrame::PrePrintNextP
       nsDeviceContext *dc = PresContext()->DeviceContext();
       PR_PL(("\n"));
       PR_PL(("***************** BeginPage *****************\n"));
       rv = dc->BeginPage();
       NS_ENSURE_SUCCESS(rv, rv);
 
       mCalledBeginPage = true;
       
-      RefPtr<gfxContext> renderingContext = dc->CreateReferenceRenderingContext();
+      RefPtr<gfxContext> renderingContext = dc->CreateRenderingContext();
       NS_ENSURE_TRUE(renderingContext, NS_ERROR_OUT_OF_MEMORY);
 
       DrawTarget* drawTarget = renderingContext->GetDrawTarget();
       if (NS_WARN_IF(!drawTarget)) {
         return NS_ERROR_FAILURE;
       }
 
       for (int32_t i = mCurrentCanvasList.Length() - 1; i >= 0 ; i--) {