Bug 877225 - Transition from snapped view shows stretched page for a moment. r=bas

This commit is contained in:
Brian R. Bondy 2013-09-15 15:30:11 -07:00
Родитель d747f1829c
Коммит 4202bb63ca
4 изменённых файлов: 14 добавлений и 6 удалений

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

@ -62,6 +62,7 @@ cairo_user_data_key_t gKeyD3D10Texture;
LayerManagerD3D10::LayerManagerD3D10(nsIWidget *aWidget)
: mWidget(aWidget)
, mDisableSequenceForNextFrame(false)
{
}
@ -245,7 +246,7 @@ LayerManagerD3D10::Initialize(bool force, HRESULT* aHresultPtr)
swapDesc.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT;
// Use double buffering to enable flip
swapDesc.BufferCount = 2;
swapDesc.Scaling = DXGI_SCALING_STRETCH;
swapDesc.Scaling = DXGI_SCALING_NONE;
// All Metro style apps must use this SwapEffect
swapDesc.SwapEffect = DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL;
swapDesc.Flags = 0;
@ -648,6 +649,7 @@ LayerManagerD3D10::VerifyBufferSize()
mSwapChain->ResizeBuffers(2, rect.width, rect.height,
DXGI_FORMAT_B8G8R8A8_UNORM,
0);
mDisableSequenceForNextFrame = true;
#endif
} else {
mSwapChain->ResizeBuffers(1, rect.width, rect.height,
@ -730,7 +732,8 @@ LayerManagerD3D10::Render(EndTransactionFlags aFlags)
if (mTarget) {
PaintToTarget();
} else {
mSwapChain->Present(0, 0);
mSwapChain->Present(0, mDisableSequenceForNextFrame ? DXGI_PRESENT_DO_NOT_SEQUENCE : 0);
mDisableSequenceForNextFrame = false;
}
LayerManager::PostPresent();
}

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

@ -170,6 +170,8 @@ private:
nsIWidget *mWidget;
bool mDisableSequenceForNextFrame;
CallbackInfo mCurrentCallbackInfo;
nsIntSize mViewport;

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

@ -63,6 +63,7 @@ CompositorD3D11::CompositorD3D11(nsIWidget* aWidget)
: mAttachments(nullptr)
, mWidget(aWidget)
, mHwnd(nullptr)
, mDisableSequenceForNextFrame(false)
{
sBackend = LAYERS_D3D11;
}
@ -270,7 +271,7 @@ CompositorD3D11::Initialize()
swapDesc.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT;
// Use double buffering to enable flip
swapDesc.BufferCount = 2;
swapDesc.Scaling = DXGI_SCALING_STRETCH;
swapDesc.Scaling = DXGI_SCALING_NONE;
// All Metro style apps must use this SwapEffect
swapDesc.SwapEffect = DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL;
swapDesc.Flags = 0;
@ -689,13 +690,13 @@ CompositorD3D11::EndFrame()
nsIntSize oldSize = mSize;
EnsureSize();
if (oldSize == mSize) {
mSwapChain->Present(0, 0);
mSwapChain->Present(0, mDisableSequenceForNextFrame ? DXGI_PRESENT_DO_NOT_SEQUENCE : 0);
mDisableSequenceForNextFrame = false;
if (mTarget) {
PaintToTarget();
}
}
mCurrentRT = nullptr;
}
@ -758,6 +759,7 @@ CompositorD3D11::VerifyBufferSize()
mSwapChain->ResizeBuffers(2, mSize.width, mSize.height,
DXGI_FORMAT_B8G8R8A8_UNORM,
0);
mDisableSequenceForNextFrame = true;
#endif
} else {
mSwapChain->ResizeBuffers(1, mSize.width, mSize.height,

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

@ -179,6 +179,7 @@ private:
VertexShaderConstants mVSConstants;
PixelShaderConstants mPSConstants;
bool mDisableSequenceForNextFrame;
};
}