summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTavmjong Bah <tavmjong@free.fr>2017-03-30 19:14:41 +0000
committertavmjong-free <tavmjong@free.fr>2017-03-30 19:14:41 +0000
commitf27f16912ec71d7567c71891badb6adb543411e9 (patch)
treefea0d21698604689b7f5979be1961854ca53f85e /src
parentAdd forgotten file from last check-in. (diff)
downloadinkscape-f27f16912ec71d7567c71891badb6adb543411e9.tar.gz
inkscape-f27f16912ec71d7567c71891badb6adb543411e9.zip
Add preference that allows user to increase the canvas tile size.
A larger tile size vastly speeds up rendering for drawings with heavy filter use by reducing the need to recalculate filter effects that cross multiple tiles. (bzr r15614)
Diffstat (limited to 'src')
-rw-r--r--src/display/sp-canvas.cpp8
-rw-r--r--src/ui/dialog/inkscape-preferences.cpp4
-rw-r--r--src/ui/dialog/inkscape-preferences.h1
3 files changed, 12 insertions, 1 deletions
diff --git a/src/display/sp-canvas.cpp b/src/display/sp-canvas.cpp
index 74aa4807a..d04c81ecb 100644
--- a/src/display/sp-canvas.cpp
+++ b/src/display/sp-canvas.cpp
@@ -1727,10 +1727,16 @@ bool SPCanvas::paintRect(int xx0, int yy0, int xx1, int yy1)
setup.mouse_loc = sp_canvas_window_to_world(this, Geom::Point(x,y));
+ static unsigned tile_multiplier = 0;
+ if (tile_multiplier == 0) {
+ Inkscape::Preferences *prefs = Inkscape::Preferences::get();
+ tile_multiplier = prefs->getIntLimited("/options/rendering/tile-multiplier", 1, 1, 64);
+ }
+
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; // 256K/4
+ setup.max_pixels = 65536 * tile_multiplier; // 256K/4
} else {
// paths only, so 1M works faster
// 1M is the cached buffer and we need 4 channels
diff --git a/src/ui/dialog/inkscape-preferences.cpp b/src/ui/dialog/inkscape-preferences.cpp
index 958d73746..646439613 100644
--- a/src/ui/dialog/inkscape-preferences.cpp
+++ b/src/ui/dialog/inkscape-preferences.cpp
@@ -1411,6 +1411,10 @@ void InkscapePreferences::initPageRendering()
_rendering_cache_size.init("/options/renderingcache/size", 0.0, 4096.0, 1.0, 32.0, 64.0, true, false);
_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, 64.0, 1.0, 4.0, 1.0, true, false);
+ _page_rendering.add_line( false, _("Rendering tile multiplier:"), _rendering_tile_multiplier, _("requires restart"), _("Set the relative size of tiles used to render the canvas. The larger the value, the bigger the tile size."), false);
+
/* blur quality */
_blur_quality_best.init ( _("Best quality (slowest)"), "/options/blurquality/value",
BLUR_QUALITY_BEST, false, 0);
diff --git a/src/ui/dialog/inkscape-preferences.h b/src/ui/dialog/inkscape-preferences.h
index 91465f6a9..e6ba4e4b2 100644
--- a/src/ui/dialog/inkscape-preferences.h
+++ b/src/ui/dialog/inkscape-preferences.h
@@ -295,6 +295,7 @@ protected:
UI::Widget::PrefCombo _switcher_style;
UI::Widget::PrefCheckButton _rendering_image_outline;
UI::Widget::PrefSpinButton _rendering_cache_size;
+ UI::Widget::PrefSpinButton _rendering_tile_multiplier;
UI::Widget::PrefSpinButton _filter_multi_threaded;
UI::Widget::PrefCheckButton _trans_scale_stroke;