From f9bee8757031e15296f459b36fe9f57c45c0ef80 Mon Sep 17 00:00:00 2001 From: Jabiertxof Date: Wed, 3 Feb 2021 20:13:54 +0100 Subject: [PATCH] Rendering in other thread This tiny MR is just to check if rendering on other thread than main improve speed in Mac as user Brenden Soares tell in issue 1614 https://gitlab.com/inkscape/inkscape/-/issues/1614#note_415422794 --- src/ui/widget/canvas.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ui/widget/canvas.cpp b/src/ui/widget/canvas.cpp index a9acea927e..1e5d7c4e2e 100644 --- a/src/ui/widget/canvas.cpp +++ b/src/ui/widget/canvas.cpp @@ -10,7 +10,7 @@ * * Released under GNU GPL v2+, read the file 'COPYING' for more information. */ - +#include #include #include @@ -964,10 +964,10 @@ Canvas::on_idle() if (!_drawing) { return false; // Disconnect } - - bool done = do_update(); + bool done = false; + std::thread t([&] {done = Inkscape::UI::Widget::Canvas::do_update();}); + t.join(); int n_rects = _clean_region->get_num_rectangles(); - // If we've drawn everything then we should have just one clean rectangle, covering the entire canvas. if (n_rects == 0) { std::cerr << "Canvas::on_idle: clean region is empty!" << std::endl; -- GitLab