Bug 991767 - Use Moz2D for printing surfaces. r=roc, a=sledru
authorMatt Woodrow <mwoodrow@mozilla.com>
Mon, 07 Apr 2014 16:07:12 +1200
changeset 183765 55422890fb8f
parent 183764 843dc71f729b
child 183766 e24aafe4dffd
push id3476
push userryanvm@gmail.com
push date2014-04-15 17:26 +0000
treeherdermozilla-beta@c8f1a4f5ca4d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc, sledru
bugs991767
milestone29.0
Bug 991767 - Use Moz2D for printing surfaces. r=roc, a=sledru
gfx/src/nsDeviceContext.cpp
--- a/gfx/src/nsDeviceContext.cpp
+++ b/gfx/src/nsDeviceContext.cpp
@@ -400,17 +400,21 @@ nsDeviceContext::CreateRenderingContext(
     // and EndPage().  But we can get away with fudging things here, if need
     // be, by using a cached copy.
     if (!printingSurface) {
       printingSurface = mCachedPrintingSurface;
     }
 #endif
     nsRefPtr<nsRenderingContext> pContext = new nsRenderingContext();
 
-    pContext->Init(this, printingSurface);
+    RefPtr<gfx::DrawTarget> dt =
+      gfxPlatform::GetPlatform()->CreateDrawTargetForSurface(printingSurface,
+                                                             gfx::IntSize(mWidth, mHeight));
+
+    pContext->Init(this, dt);
     pContext->Scale(mPrintingScale, mPrintingScale);
     aContext = pContext;
     NS_ADDREF(aContext);
 
     return NS_OK;
 }
 
 nsresult