mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 743393: Reset scissorrect when clearing surfaces. r=jrmuizel
This commit is contained in:
parent
fa18d1f970
commit
189797aaee
@ -365,36 +365,6 @@ ThebesLayerD3D10::VerifyContentType(SurfaceMode aMode)
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
ThebesLayerD3D10::SetupDualViewports(const gfxIntSize &aSize)
|
||||
{
|
||||
D3D10_VIEWPORT viewport;
|
||||
viewport.MaxDepth = 1.0f;
|
||||
viewport.MinDepth = 0;
|
||||
viewport.Width = aSize.width;
|
||||
viewport.Height = aSize.height;
|
||||
viewport.TopLeftX = 0;
|
||||
viewport.TopLeftY = 0;
|
||||
|
||||
D3D10_VIEWPORT vps[2] = { viewport, viewport };
|
||||
device()->RSSetViewports(2, vps);
|
||||
|
||||
gfx3DMatrix projection;
|
||||
/*
|
||||
* Matrix to transform to viewport space ( <-1.0, 1.0> topleft,
|
||||
* <1.0, -1.0> bottomright)
|
||||
*/
|
||||
projection._11 = 2.0f / aSize.width;
|
||||
projection._22 = -2.0f / aSize.height;
|
||||
projection._33 = 0.0f;
|
||||
projection._41 = -1.0f;
|
||||
projection._42 = 1.0f;
|
||||
projection._44 = 1.0f;
|
||||
|
||||
effect()->GetVariableByName("mProjection")->
|
||||
SetRawValue(&projection._11, 0, 64);
|
||||
}
|
||||
|
||||
void
|
||||
ThebesLayerD3D10::FillTexturesBlackWhite(const nsIntRegion& aRegion, const nsIntPoint& aOffset)
|
||||
{
|
||||
@ -410,13 +380,20 @@ ThebesLayerD3D10::FillTexturesBlackWhite(const nsIntRegion& aRegion, const nsInt
|
||||
device()->CreateRenderTargetView(mTexture, NULL, getter_AddRefs(viewBlack));
|
||||
device()->CreateRenderTargetView(mTextureOnWhite, NULL, getter_AddRefs(viewWhite));
|
||||
|
||||
D3D10_RECT oldScissor;
|
||||
UINT numRects = 1;
|
||||
device()->RSGetScissorRects(&numRects, &oldScissor);
|
||||
|
||||
D3D10_TEXTURE2D_DESC desc;
|
||||
mTexture->GetDesc(&desc);
|
||||
|
||||
D3D10_RECT scissor = { 0, 0, desc.Width, desc.Height };
|
||||
device()->RSSetScissorRects(1, &scissor);
|
||||
|
||||
mD3DManager->SetupInputAssembler();
|
||||
nsIntSize oldVP = mD3DManager->GetViewport();
|
||||
|
||||
SetupDualViewports(gfxIntSize(desc.Width, desc.Height));
|
||||
mD3DManager->SetViewport(nsIntSize(desc.Width, desc.Height));
|
||||
|
||||
ID3D10RenderTargetView *views[2] = { viewBlack, viewWhite };
|
||||
device()->OMSetRenderTargets(2, views, NULL);
|
||||
@ -448,6 +425,7 @@ ThebesLayerD3D10::FillTexturesBlackWhite(const nsIntRegion& aRegion, const nsInt
|
||||
views[0] = oldRT;
|
||||
device()->OMSetRenderTargets(1, views, NULL);
|
||||
mD3DManager->SetViewport(oldVP);
|
||||
device()->RSSetScissorRects(1, &oldScissor);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -97,8 +97,6 @@ private:
|
||||
/* Create a new texture */
|
||||
void CreateNewTextures(const gfxIntSize &aSize, SurfaceMode aMode);
|
||||
|
||||
void SetupDualViewports(const gfxIntSize &aSize);
|
||||
|
||||
// Fill textures with opaque black and white in the specified region.
|
||||
void FillTexturesBlackWhite(const nsIntRegion& aRegion, const nsIntPoint& aOffset);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user