Bug 991575 - Stop PresShell::GetReferenceRenderingContext from creating a Thebes backed gfxContext (Moz2D migration). r=mattwoodrow

This commit is contained in:
Jonathan Watt 2014-04-04 09:15:57 +01:00
parent 00e3bb9eeb
commit 2b13f3c0b0
3 changed files with 9 additions and 1 deletions

View File

@ -83,6 +83,13 @@ nsRenderingContext::Init(nsDeviceContext* aContext,
mP2A = mDeviceContext->AppUnitsPerDevPixel();
}
void
nsRenderingContext::Init(nsDeviceContext* aContext,
DrawTarget* aDrawTarget)
{
Init(aContext, new gfxContext(aDrawTarget));
}
//
// graphics state
//

View File

@ -48,6 +48,7 @@ public:
void Init(nsDeviceContext* aContext, gfxASurface* aThebesSurface);
void Init(nsDeviceContext* aContext, gfxContext* aThebesContext);
void Init(nsDeviceContext* aContext, DrawTarget* aDrawTarget);
// These accessors will never return null.
gfxContext *ThebesContext() { return mThebes; }

View File

@ -2901,7 +2901,7 @@ PresShell::GetReferenceRenderingContext()
nsRefPtr<nsRenderingContext> rc;
if (mPresContext->IsScreen()) {
rc = new nsRenderingContext();
rc->Init(devCtx, gfxPlatform::GetPlatform()->ScreenReferenceSurface());
rc->Init(devCtx, gfxPlatform::GetPlatform()->ScreenReferenceDrawTarget());
} else {
devCtx->CreateRenderingContext(*getter_AddRefs(rc));
}