Commit 17330ad0 authored by Jabier Arraiza's avatar Jabier Arraiza

Backport from trunk. Add filter render in 1 pass and remove banding on filters

parent 5aff6bad
Pipeline #39634809 failed with stages
in 65 minutes and 13 seconds
......@@ -697,6 +697,15 @@ DrawingItem::render(DrawingContext &dc, Geom::IntRect const &area, unsigned flag
// carea is the area to paint
Geom::OptIntRect carea = Geom::intersect(area, _drawbox);
// expand render on filtered items
Geom::OptIntRect cl = _cacheRect();
if (_filter != nullptr && render_filters && cl) {
setCached(true, true);
carea = cl;
if (!carea) return RENDER_OK;
if (_antialias) {
......@@ -717,8 +726,6 @@ DrawingItem::render(DrawingContext &dc, Geom::IntRect const &area, unsigned flag
// There is no cache. This could be because caching of this item
// was just turned on after the last update phase, or because
// we were previously outside of the canvas.
Geom::OptIntRect cl = _drawing.cacheLimit();
if (cl) {
_cache = new DrawingCache(*cl);
  • @jabiertxof , can you explain a bit what this does? Then I can add it to release notes for 0.92.4.

  • Hi Maren, Canvas are divided by tiles, and a tile can split into parts a item, If this item has filter, the filter need to be reprocesed in each tile.

    Whith this only process one time. Practicaly it speedup filters like blur at high zoom.

  • How does this work together with the preferences tile number option? Is this making Inkscape slower (in relevant areas) on slow computers?

  • @jabiertxof ping :)

    So this overrides the tiling option in preferences?

  • Only for filtered elements, is the faster way to render a filtered element, no matter where compurter are rendering

    Edited by Jabier Arraiza
  • Thank you!

  • About the 'remove banding' part, that's not the dithering thing that needs to be fixed in Cairo, right? But some other kind of banding? @jabiertxof ?

  • Yes they are tiny diferent rendering results in, for example, blur calculations for each tile. Zoom a loot to a blur and see it.

  • I don't see a difference :-/ Both in 0.92.x and 0.92.3, I can see 'steps' in the blur.

  • you has the last x code? could you send me a screenshot? Thanks in advance.

  • This is the kind of banding should be fixed: banding

  • Set a tiny tile option preference to better view, I use 1 in my example.

  • Okay, so:

    • opening the file is a lot faster, also resizing of the window
    • dragging/zooming isn't very different when I just compare the canvas reactivity. Processor load seems about halved, so probably it's an issue of selecting the correct test case that would hit my computer harder.
    • for the blur filter, I cannot find a difference (German: 0.92.x, compiled yesterday, English: 0.92.3 from Ubuntu repos) - it's quite good for both: Bildschirmfoto_2018-12-31_16-55-43
  • (but both have minimal banding) I have also tried applying the filter separately in both versions, in case the change is on the filter itself, but that does not make a difference.

  • Toggle commit list
  • Could you compare this file, just open with your previous showing prefs? banding.blur.svg

  • maybe you need tweak a bit your monitor settings to view the banding

  • also in this file could test the preformance

  • @Moini banding is noticiable in al filter quelities except in best quality. Sorry for dont point you correctly.

  • Anyway speed improvement is on all qualityes

  • A couple of screenshots:

    Quality settings for blur/filters 'good' - banding seems to be finer in 0.92.x than in 0.92.3 (but other type of banding):


    Quality settings for blur/filters 'average' (different part of SVG with more visible banding for me. Banding is vertical in 0.92.3, horizontal in 0.92.x):


    Quality settings 'lower' (banding pattern is different, but not necessarily better):





  • @Moini this drive me crazy. forget include in release notes but please check it with fresh prefercenes. In all my computers the banding you show me in .x dosen't happend, except "normal" the follow path dir circular one. I m speaking the straight banding only.

    Also dont show in @ede123 computer, the person who notice me the fix. The original goal is speedup.

    Edited by Jabier Arraiza
  • I scrolled down a bit - the place that shows when the file is opened looks fine, but it gets banded below. It can't have to do with any flags or library versions?

    Renamed prefs, and a new one was written.


  • Or maybe I need to fully clean the build dir?

  • No, that didn't help. Sorry :-(

  • Yes bands is normall on scroll in both branches, there is other filter operation when you go outside the cache area.

  • The screenshot was not taken during scrolling, but after. Rendering was finished.

  • anyway, in the moment you scroll banding happends, to solve it I can add a check to know if filtered element ovelap cache limits to redraw whole sceen and full remove banding. I think is easy. I think it can be done this weekend.

Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment