mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 13:48:06 +02:00
wgl: Use an hwnd xor hdc for framebuffers
It seems maybe hdcs can get recycled? Fixes:28058221("wgl: Support contexts created from non-window DCs") (cherry picked from commit3f35e65253) Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41269>
This commit is contained in:
parent
d87649d8be
commit
4083a34188
3 changed files with 4 additions and 3 deletions
|
|
@ -1194,7 +1194,7 @@
|
|||
"description": "wgl: Use an hwnd xor hdc for framebuffers",
|
||||
"nominated": true,
|
||||
"nomination_type": 2,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": "2805822141bb392cc282d9ffaad2ff49f57a23e0",
|
||||
"notes": null
|
||||
|
|
|
|||
|
|
@ -543,8 +543,9 @@ get_unlocked_refd_framebuffer_from_dc(HDC hDC)
|
|||
* those here.
|
||||
*/
|
||||
int iPixelFormat = stw_pixelformat_guess(hDC);
|
||||
HWND hWnd = WindowFromDC(hDC);
|
||||
if (iPixelFormat)
|
||||
fb = stw_framebuffer_create(hDC, WindowFromDC(hDC), stw_pixelformat_get_info(iPixelFormat), STW_FRAMEBUFFER_WGL_WINDOW, stw_dev->fscreen);
|
||||
fb = stw_framebuffer_create(hWnd ? NULL : hDC, hWnd, stw_pixelformat_get_info(iPixelFormat), STW_FRAMEBUFFER_WGL_WINDOW, stw_dev->fscreen);
|
||||
if (!fb)
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -475,7 +475,7 @@ stw_framebuffer_from_hdc_locked(HDC hdc)
|
|||
|
||||
hwnd = WindowFromDC(hdc);
|
||||
|
||||
return stw_framebuffer_from_hwnd_hdc_locked(hwnd, hdc);
|
||||
return stw_framebuffer_from_hwnd_hdc_locked(hwnd, hwnd ? NULL : hdc);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue