From 3166da4cac0b0692e9f0e1be0b189d2a6ec0c3a8 Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Date: Sat, 19 Oct 2019 20:16:59 +0200 Subject: [PATCH 1/3] Add a increase of default tiles based on canvas resolution, great for big displays --- src/display/sp-canvas.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/display/sp-canvas.cpp b/src/display/sp-canvas.cpp index a2901741ad..e0406883ed 100644 --- a/src/display/sp-canvas.cpp +++ b/src/display/sp-canvas.cpp @@ -2234,7 +2234,11 @@ bool SPCanvas::paintRect(int xx0, int yy0, int xx1, int yy1) // 1M is the cached buffer and we need 4 channels setup.max_pixels = 262144; } - + // Take account of the canvas size to use biger tiles + double exponent_size = allocation.width / 1024.0; + if (exponent_size > 1) { + setup.max_pixels *= exponent_size; + } // Start the clock setup.start_time = g_get_monotonic_time(); // Go -- GitLab From 69ed291b9ce9b79697f7abc46a8450c9d74027ba Mon Sep 17 00:00:00 2001 From: Jabiertxof Date: Mon, 28 Oct 2019 11:36:47 +0100 Subject: [PATCH 2/3] Enable debug performance --- src/display/sp-canvas.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/display/sp-canvas.cpp b/src/display/sp-canvas.cpp index e0406883ed..83d3ffd24c 100644 --- a/src/display/sp-canvas.cpp +++ b/src/display/sp-canvas.cpp @@ -59,7 +59,7 @@ static bool const HAS_BROKEN_MOTION_HINTS = true; //#define DEBUG_REDRAW 1; // Define this to output the time spent in a full idle loop and the number of "tiles" painted -//#define DEBUG_PERFORMANCE 1; +#define DEBUG_PERFORMANCE 1; // Tiles are a way to minimize the number of redraws, eliminating too small redraws. // The canvas stores a 2D array of ints, each representing a TILE_SIZExTILE_SIZE pixels tile. -- GitLab From afedbf16804c547b0a829f3d043d42cc3150e87b Mon Sep 17 00:00:00 2001 From: Jabiertxof Date: Mon, 28 Oct 2019 13:13:15 +0100 Subject: [PATCH 3/3] Add @ede123 sugestion to fixed tiles --- src/display/sp-canvas.cpp | 15 +++++++++------ src/ui/dialog/inkscape-preferences.cpp | 6 +++--- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/display/sp-canvas.cpp b/src/display/sp-canvas.cpp index 83d3ffd24c..33f2e42ac4 100644 --- a/src/display/sp-canvas.cpp +++ b/src/display/sp-canvas.cpp @@ -2228,17 +2228,20 @@ bool SPCanvas::paintRect(int xx0, int yy0, int xx1, int yy1) if (_rendermode != Inkscape::RENDERMODE_OUTLINE) { // use 256K as a compromise to not slow down gradients // 256K is the cached buffer and we need 4 channels - setup.max_pixels = 65536 * tile_multiplier; // 256K/4 + //setup.max_pixels = 65536 * tile_multiplier; // 256K/4 + double factor = 5.0; + if (allocation.width < 1500) { + factor = 3.0; + } else if(allocation.width < 2600) { + factor = 4.0; + } + setup.max_pixels = allocation.width * allocation.height / factor; } else { // paths only, so 1M works faster // 1M is the cached buffer and we need 4 channels setup.max_pixels = 262144; } - // Take account of the canvas size to use biger tiles - double exponent_size = allocation.width / 1024.0; - if (exponent_size > 1) { - setup.max_pixels *= exponent_size; - } + // Start the clock setup.start_time = g_get_monotonic_time(); // Go diff --git a/src/ui/dialog/inkscape-preferences.cpp b/src/ui/dialog/inkscape-preferences.cpp index cd9396e981..cd59645900 100644 --- a/src/ui/dialog/inkscape-preferences.cpp +++ b/src/ui/dialog/inkscape-preferences.cpp @@ -2009,9 +2009,9 @@ void InkscapePreferences::initPageRendering() _page_rendering.add_line( false, _("Rendering _cache size:"), _rendering_cache_size, C_("mebibyte (2^20 bytes) abbreviation","MiB"), _("Set the amount of memory per document which can be used to store rendered parts of the drawing for later reuse; set to zero to disable caching"), false); // rendering tile multiplier - _rendering_tile_multiplier.init("/options/rendering/tile-multiplier", 1.0, 512.0, 1.0, 16.0, 16.0, true, false); - _page_rendering.add_line( false, _("Rendering tile multiplier:"), _rendering_tile_multiplier, "", - _("On modern hardware, increasing this value (default is 16) can help to get a better performance when there are large areas with filtered objects (this includes blur and blend modes) in your drawing. Decrease the value to make zooming and panning in relevant areas faster on low-end hardware in drawings with few or no filters."), false); + //_rendering_tile_multiplier.init("/options/rendering/tile-multiplier", 1.0, 512.0, 1.0, 16.0, 16.0, true, false); + //_page_rendering.add_line( false, _("Rendering tile multiplier:"), _rendering_tile_multiplier, "", + // _("On modern hardware, increasing this value (default is 16) can help to get a better performance when there are large areas with filtered objects (this includes blur and blend modes) in your drawing. Decrease the value to make zooming and panning in relevant areas faster on low-end hardware in drawings with few or no filters."), false); // rendering xray radius _rendering_xray_radius.init("/options/rendering/xray-radius", 1.0, 1500.0, 1.0, 100.0, 100.0, true, false); -- GitLab