Bug 1329574 - enable depth-buffer for WGL gl context. r=jgilbert

MozReview-Commit-ID: ISIhJOa6CBL
This commit is contained in:
JerryShih 2017-01-13 20:02:20 +08:00
parent 0d06f1859b
commit d154c247dd

View File

@ -55,6 +55,11 @@ WGLLibrary::CreateDummyWindow(HDC* aWindowDC)
NS_ENSURE_TRUE(dc, nullptr);
if (mWindowPixelFormat == 0) {
int depthBits = 0;
if (gfxPrefs::WebRenderEnabled()) {
depthBits = 24;
}
PIXELFORMATDESCRIPTOR pfd;
ZeroMemory(&pfd, sizeof(PIXELFORMATDESCRIPTOR));
pfd.nSize = sizeof(PIXELFORMATDESCRIPTOR);
@ -66,7 +71,7 @@ WGLLibrary::CreateDummyWindow(HDC* aWindowDC)
pfd.cGreenBits = 8;
pfd.cBlueBits = 8;
pfd.cAlphaBits = 8;
pfd.cDepthBits = 0;
pfd.cDepthBits = depthBits;
pfd.iLayerType = PFD_MAIN_PLANE;
mWindowPixelFormat = ChoosePixelFormat(dc, &pfd);