Bug 743148: Setup input assembler for component alpha filling. r=jrmuizel

This commit is contained in:
Bas Schouten 2012-04-11 18:17:40 +02:00
parent 7f5ebe1f29
commit a25be3f8c2
3 changed files with 15 additions and 6 deletions

View File

@ -537,6 +537,18 @@ LayerManagerD3D10::SetViewport(const nsIntSize &aViewport)
}
}
void
LayerManagerD3D10::SetupInputAssembler()
{
mDevice->IASetInputLayout(mInputLayout);
UINT stride = sizeof(Vertex);
UINT offset = 0;
ID3D10Buffer *buffer = mVertexBuffer;
mDevice->IASetVertexBuffers(0, 1, &buffer, &stride, &offset);
mDevice->IASetPrimitiveTopology(D3D10_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP);
}
void
LayerManagerD3D10::SetupPipeline()
{
@ -558,13 +570,8 @@ LayerManagerD3D10::SetupPipeline()
ID3D10RenderTargetView *view = mRTView;
mDevice->OMSetRenderTargets(1, &view, NULL);
mDevice->IASetInputLayout(mInputLayout);
UINT stride = sizeof(Vertex);
UINT offset = 0;
ID3D10Buffer *buffer = mVertexBuffer;
mDevice->IASetVertexBuffers(0, 1, &buffer, &stride, &offset);
mDevice->IASetPrimitiveTopology(D3D10_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP);
SetupInputAssembler();
SetViewport(nsIntSize(rect.width, rect.height));
}

View File

@ -184,6 +184,7 @@ public:
ReadbackManagerD3D10 *readbackManager();
void SetupInputAssembler();
void SetViewport(const nsIntSize &aViewport);
const nsIntSize &GetViewport() { return mViewport; }

View File

@ -413,6 +413,7 @@ ThebesLayerD3D10::FillTexturesBlackWhite(const nsIntRegion& aRegion, const nsInt
D3D10_TEXTURE2D_DESC desc;
mTexture->GetDesc(&desc);
mD3DManager->SetupInputAssembler();
nsIntSize oldVP = mD3DManager->GetViewport();
SetupDualViewports(gfxIntSize(desc.Width, desc.Height));