Bug 593224 - ContainerLayerD3D9 can reset the clip rect r=Bas, a=blocking2.0

This commit is contained in:
Matt Woodrow 2010-09-03 15:50:53 +12:00
Родитель 593ea4944b
Коммит d892767b19
1 изменённых файлов: 3 добавлений и 0 удалений

Просмотреть файл

@ -141,6 +141,7 @@ ContainerLayerD3D9::RenderLayer()
nsRefPtr<IDirect3DSurface9> previousRenderTarget;
nsRefPtr<IDirect3DTexture9> renderTexture;
float previousRenderTargetOffset[4];
RECT oldClipRect;
float renderTargetOffset[] = { 0, 0, 0, 0 };
float oldViewMatrix[4][4];
@ -149,6 +150,7 @@ ContainerLayerD3D9::RenderLayer()
if (useIntermediate) {
device()->GetRenderTarget(0, getter_AddRefs(previousRenderTarget));
device()->GetScissorRect(&oldClipRect);
device()->CreateTexture(visibleRect.width, visibleRect.height, 1,
D3DUSAGE_RENDERTARGET, D3DFMT_A8R8G8B8,
D3DPOOL_DEFAULT, getter_AddRefs(renderTexture),
@ -224,6 +226,7 @@ ContainerLayerD3D9::RenderLayer()
if (useIntermediate) {
device()->SetRenderTarget(0, previousRenderTarget);
device()->SetScissorRect(&oldClipRect);
device()->SetVertexShaderConstantF(12, previousRenderTargetOffset, 1);
device()->SetVertexShaderConstantF(8, &oldViewMatrix[0][0], 4);