Bug 991767 - Use Moz2D for printing surfaces. r=roc, a=sledru
☠☠ backed out by 5fc53b821f69 ☠ ☠
authorMatt Woodrow <mwoodrow@mozilla.com>
Mon, 07 Apr 2014 16:07:12 +1200
changeset 191701 c24d5055dc0184e1dc6fa3aa407df22901bd9721
parent 191700 56eb28be7cb57e7647cce8d6e4b897d5bb0d6aae
child 191702 64c58ec763c41ab071fc83ed5825ac0c91a2fdff
push id3503
push userraliiev@mozilla.com
push dateMon, 28 Apr 2014 18:51:11 +0000
treeherdermozilla-beta@c95ac01e332e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc, sledru
bugs991767
milestone30.0a2
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
@@ -389,17 +389,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