Bug 624170. Part 1: Don't try to release the DC for null surfaces. r=bas; a=blocking-beta9+ landed on a CLOSED TREE

This commit is contained in:
Robert O'Callahan 2011-01-10 17:24:10 -05:00
parent 79c9c9869f
commit 53cc70b575

View File

@ -319,6 +319,7 @@ class OpaqueRenderer {
public:
OpaqueRenderer(const nsIntRegion& aUpdateRegion) :
mUpdateRegion(aUpdateRegion), mDC(NULL) {}
~OpaqueRenderer() { End(); }
already_AddRefed<gfxWindowsSurface> Begin(LayerD3D9* aLayer);
void End();
IDirect3DTexture9* GetTexture() { return mTmpTexture; }
@ -365,7 +366,11 @@ OpaqueRenderer::Begin(LayerD3D9* aLayer)
void
OpaqueRenderer::End()
{
mSurface->ReleaseDC(mDC);
if (mSurface && mDC) {
mSurface->ReleaseDC(mDC);
mSurface = NULL;
mDC = NULL;
}
}
static void
@ -437,12 +442,13 @@ ThebesLayerD3D9::DrawRegion(const nsIntRegion &aRegion, SurfaceMode aMode)
}
}
if (destinationSurface) {
nsRefPtr<gfxContext> context = new gfxContext(destinationSurface);
context->Translate(gfxPoint(-bounds.x, -bounds.y));
LayerManagerD3D9::CallbackInfo cbInfo = mD3DManager->GetCallbackInfo();
cbInfo.Callback(this, context, aRegion, nsIntRegion(), cbInfo.CallbackData);
}
if (!destinationSurface)
return;
nsRefPtr<gfxContext> context = new gfxContext(destinationSurface);
context->Translate(gfxPoint(-bounds.x, -bounds.y));
LayerManagerD3D9::CallbackInfo cbInfo = mD3DManager->GetCallbackInfo();
cbInfo.Callback(this, context, aRegion, nsIntRegion(), cbInfo.CallbackData);
nsAutoTArray<IDirect3DTexture9*,2> srcTextures;
nsAutoTArray<IDirect3DTexture9*,2> destTextures;