From 84942175ca31385adbd83c382b17247fd733c1a1 Mon Sep 17 00:00:00 2001 From: David Capello Date: Fri, 14 Jun 2024 21:01:25 -0300 Subject: [PATCH] [gpu] Avoid reading pixels from a GPU surface to move a window On CPU we might try to blit the old content of the window in a new location, but with a GPU this operation is super slow, it's fast just to draw everything again. --- src/ui/window.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/ui/window.cpp b/src/ui/window.cpp index 16682f08e..70bf2c616 100644 --- a/src/ui/window.cpp +++ b/src/ui/window.cpp @@ -845,6 +845,13 @@ void Window::moveWindow(const gfx::Rect& rect, bool use_blit) // In second place, we have to setup the window invalid region... + // If the GPU acceleration is enabled on this window we avoid + // copying regions of pixels as it's super slow to read GPU + // surfaces. + if (display()->nativeWindow()->gpuAcceleration()) { + use_blit = false; + } + // If "use_blit" isn't activated, we have to redraw the whole window // (sending kPaintMessage messages) in the new drawable region if (!use_blit) {