Commit 585b3d0e by nduca@chromium.org

Disable use of FlipEx for problematic use cases.

It seems that DWM will, when given an HWND that has an associated FlipEX swap chain, stretch the contents of the HWND to fill the new window IF you don't issue draw calls to that HWND before the WM_PAINT returns. This leads to horrendous sizing artifacts. For Chromium, this is a show stopper. But, FlipEx is definitely a good thing, for regular single process applications. So, is there a clean way to conditionally disable FlipEX for these problem cases? The heuristic in this patch basically says "if your hwnd is not in-process, then you're probably not painting in its HWND, so don't sue FlipEX." This catches the Chromium use case. There is still the possibility of a regular single-process EGL application that tries to draw outside WM_PAINT that would experience sizing artefacts. But, maybe that's OK. Anyways, I'm not married to this technique. Just throwing something out there to start the discussion. :) Review URL: http://codereview.appspot.com/4536102 git-svn-id: https://angleproject.googlecode.com/svn/trunk@668 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent 8ab69840
......@@ -143,6 +143,16 @@ bool Surface::resetSwapChain(int backbufferWidth, int backbufferHeight)
bool useFlipEx = (LOWORD(GetVersion()) >= 0x61) && mDisplay->isD3d9ExDevice();
// FlipEx causes unseemly stretching when resizing windows AND when one
// draws outside of the WM_PAINT callback. While this is seldom a problem in
// single process applications, it is particuarly noticeable in multi-process
// applications. Therefore, if we find that the creator process of our window
// is not the current process, disable use of FlipEx.
DWORD windowPID;
GetWindowThreadProcessId(mWindow, &windowPID);
if(windowPID != GetCurrentProcessId())
useFlipEx = false;
presentParameters.AutoDepthStencilFormat = mConfig->mDepthStencilFormat;
// We set BackBufferCount = 1 even when we use D3DSWAPEFFECT_FLIPEX.
// We do this because DirectX docs are a bit vague whether to set this to 1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment