diff --git a/gfx/src/nsDeviceContext.cpp b/gfx/src/nsDeviceContext.cpp index e2a75575cd2..8c03dde3f3d 100644 --- a/gfx/src/nsDeviceContext.cpp +++ b/gfx/src/nsDeviceContext.cpp @@ -394,7 +394,11 @@ nsDeviceContext::CreateRenderingContext(nsRenderingContext *&aContext) #endif nsRefPtr pContext = new nsRenderingContext(); - pContext->Init(this, printingSurface); + RefPtr dt = + gfxPlatform::GetPlatform()->CreateDrawTargetForSurface(printingSurface, + gfx::IntSize(mWidth, mHeight)); + + pContext->Init(this, dt); pContext->Scale(mPrintingScale, mPrintingScale); aContext = pContext; NS_ADDREF(aContext);