diff options
author | Campbell Barton <campbell@blender.org> | 2022-08-17 05:53:35 +0300 |
---|---|---|
committer | Campbell Barton <campbell@blender.org> | 2022-08-17 05:58:17 +0300 |
commit | 48da8c40405c3901df87b6388128ca2d73a4f656 (patch) | |
tree | fbde3fc7b60f14fb0637967cab7e794ac3a992dc /source/blender/editors/screen | |
parent | 54827bb7cd8bd060a9588b5b0e01eec887c6a971 (diff) |
Fix T98462: Save Screenshot (glReadPixels) fails under Wayland
Use an off-screen buffer for the screen-shot operator.
Reading from the front-buffer immediately after calling swap-buffers
failed for GHOST/Wayland in some cases.
While EGL can request to preserve the front-buffer while drawing,
this isn't always supported. So workaround the problem by avoiding
use of the front-buffer entirely.
Diffstat (limited to 'source/blender/editors/screen')
-rw-r--r-- | source/blender/editors/screen/screendump.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/source/blender/editors/screen/screendump.c b/source/blender/editors/screen/screendump.c index 5464d0a347d..38a9d8ba7ab 100644 --- a/source/blender/editors/screen/screendump.c +++ b/source/blender/editors/screen/screendump.c @@ -54,13 +54,12 @@ static int screenshot_data_create(bContext *C, wmOperator *op, ScrArea *area) { int dumprect_size[2]; - wmWindowManager *wm = CTX_wm_manager(C); wmWindow *win = CTX_wm_window(C); /* do redraw so we don't show popups/menus */ WM_redraw_windows(C); - uint *dumprect = WM_window_pixels_read(wm, win, dumprect_size); + uint *dumprect = WM_window_pixels_read_offscreen(C, win, dumprect_size); if (dumprect) { ScreenshotData *scd = MEM_callocN(sizeof(ScreenshotData), "screenshot"); |