Bug 1280324, part 3 - Fix various nsDeviceContext::CreateRenderingContext to call CreateReferenceRenderingContext instead. r=edwin
authorJonathan Watt <jwatt@jwatt.org>
Thu, 27 Oct 2016 19:25:01 +0100
changeset 320198 20f8aeb59ada4e5165ea585c490c62c0e5d4f2f3
parent 320197 620893e272d615af3192524b9ca959890f9a2c24
child 320199 afb9ba10005efaddaa9ec736f9c6bf058d4c6362
push id20751
push userphilringnalda@gmail.com
push dateSun, 30 Oct 2016 18:06:35 +0000
treeherderfx-team@e3279760cd97 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersedwin
bugs1280324
milestone52.0a1
Bug 1280324, part 3 - Fix various nsDeviceContext::CreateRenderingContext to call CreateReferenceRenderingContext instead. r=edwin
layout/base/nsPresShell.cpp
layout/generic/nsSimplePageSequenceFrame.cpp
layout/printing/PrintTranslator.cpp
--- a/layout/base/nsPresShell.cpp
+++ b/layout/base/nsPresShell.cpp
@@ -2976,17 +2976,17 @@ PresShell::CreateReferenceRenderingConte
   nsDeviceContext* devCtx = mPresContext->DeviceContext();
   RefPtr<gfxContext> rc;
   if (mPresContext->IsScreen()) {
     rc = gfxContext::CreateOrNull(gfxPlatform::GetPlatform()->ScreenReferenceDrawTarget());
   } else {
     // We assume the devCtx has positive width and height for this call.
     // However, width and height, may be outside of the reasonable range
     // so rc may still be null.
-    rc = devCtx->CreateRenderingContext();
+    rc = devCtx->CreateReferenceRenderingContext();
   }
 
   return rc ? rc.forget() : nullptr;
 }
 
 nsresult
 PresShell::GoToAnchor(const nsAString& aAnchorName, bool aScroll,
                       uint32_t aAdditionalScrollFlags)
--- a/layout/generic/nsSimplePageSequenceFrame.cpp
+++ b/layout/generic/nsSimplePageSequenceFrame.cpp
@@ -630,17 +630,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->CreateRenderingContext();
+      RefPtr<gfxContext> renderingContext = dc->CreateReferenceRenderingContext();
       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--) {
--- a/layout/printing/PrintTranslator.cpp
+++ b/layout/printing/PrintTranslator.cpp
@@ -15,17 +15,17 @@
 using namespace mozilla::gfx;
 
 namespace mozilla {
 namespace layout {
 
 PrintTranslator::PrintTranslator(nsDeviceContext* aDeviceContext)
   : mDeviceContext(aDeviceContext)
 {
-  RefPtr<gfxContext> context = mDeviceContext->CreateRenderingContext();
+  RefPtr<gfxContext> context = mDeviceContext->CreateReferenceRenderingContext();
   mBaseDT = context->GetDrawTarget();
 }
 
 bool
 PrintTranslator::TranslateRecording(std::istream& aRecording)
 {
   uint32_t magicInt;
   ReadElement(aRecording, magicInt);