Bug report #2596

avoid useless canvas redraws

Added by aperi2007 - about 14 years ago. Updated over 9 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:Map Canvas
Affected QGIS version:master Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:duplicate
Crashes QGIS or corrupts data:No Copied to github as #:12656

Description

Starting with a layer switch-on, if the layer is switch-off.
The canvas is redraw one time again with the layer switch-on before draw the canvas without the layer.

This is time consuming action if the layer switched-off is a big archive with a large extent.


Related issues

Related to QGIS Application - Bug report #5087: An action that makes the Identify Results dock appear for... Closed 2012-02-24

History

#1 Updated by Paolo Cavallini almost 14 years ago

Does enabling cache improve this significantly?

#2 Updated by aperi2007 - almost 14 years ago

I do some tests.
It happened even with shapefile.

If I checked the "use cache render" this don't happened.

It don't happened even if I deselect the "use cache render", but set
the number of features to draw before updating the display to zero (0).

In effect it seem happened only when this settings is set to some number other than zero.

Infact I usually use as settings 3000 or 5000 features because I have postres with
some table very big (1.000.000 features and so on).
And use the 0 setting is unacceptable because it mean wait some minutes before to see something (to full-extent).
I surely prefer set to 5000 features before drawing to have a feedback of progress of display-ing.
But this double redrawing is quite boring.

Now I test better with the use of caching.

Replying to [comment:1 pcav]:

Does enabling cache improve this significantly?

#3 Updated by Volker Fröhlich over 13 years ago

Can't see that happen at all using Trunk on Linux -- with or without rendering cache.

Can you test with Trunk?

#4 Updated by Giovanni Manghi over 13 years ago

I'm able to see what Andrea is saying.

*) With render caching enabled, then the "number of features to be drawn before updating the display" does not work anymore. If you refresh the map the vector will be rendered as if the option is set to "0", so I guess that it would be needed to disabled this option when the render caching is enabled.

*) With the render caching is disabled and you choose something different from "0" in "number of features to be drawn before updating the display" (and you are using a vector with many features, I'm testing myself a 50000 polygons vector) then the problem is evident.

Add another (small) vector and then start enabling/disabling it in the TOC, the big vector is continuously redrawn at each click... very annoying.

In general without render caching enabled (and "number of features to be drawn before updating the display" set to 0), enabling/disabling a vector in a project where there are many others vectors, or a few big ones, it takes really a lot.

I'm on trunk/ubuntu 10,04 and with the render caching enabled, on the contrary, it works really smooth.

It the options enabled by default?

#5 Updated by Giovanni Manghi over 13 years ago

Now I can see even better:

have a look at the following screencast:

http://www.faunalia.pt/downlaods/redrawns.mpeg

the vectors seems to be redrawn TWICE when toggling editing and it is even redrawn when clicking "Ok" or "apply" in QGIS menus.

#7 Updated by Volker Fröhlich over 13 years ago

Thank you, can see it now.

#8 Updated by Paolo Cavallini almost 13 years ago

  • Tracker changed from Bug report to 4
  • Assignee deleted (nobody -)
  • Start date set to 2011-07-25
  • Pull Request or Patch supplied set to No

#9 Updated by Giovanni Manghi over 12 years ago

  • Target version deleted (Version 1.7.0)
  • Subject changed from One draw too much on switch off to avoid useless canvas redraws
  • Priority changed from Low to Normal

Another useless redraw is when clicking "OK" after having clicked on "APPLY", for example in vector or raster properties.

#10 Updated by Giovanni Manghi over 12 years ago

another useless redraw:

when the identify window is set to be opened docked but it is not (yet) visible: picking the identify tool (or any other one) causes the canvas to be refreshed.

#11 Updated by Giovanni Manghi over 12 years ago

another useless redraw, see #2352

#12 Updated by Giovanni Manghi over 12 years ago

  • Target version set to Version 1.7.4

#13 Updated by Giovanni Manghi over 12 years ago

Another huge waste of time:

in a project add a group of layers plus other layers and some kind of overlay. I tested with a bunch of PostGIS layers, some of them grouped and a WMS overlay. When removing the group it seems that the canvas is redrawn as many times as the number of layers in the group being removed.

#14 Updated by Giovanni Manghi over 12 years ago

  • Affected QGIS version set to master
  • Crashes QGIS or corrupts data set to No

Another useless redraws (from #4789):

If I open the Add PostGIS layer dialog and do nothing, just hit Close, the whole view re-renders. This causes needless CPU usage and delays when no re-render was needed.

#15 Updated by Giovanni Manghi over 12 years ago

see also #3427

#16 Updated by Aren Cambre about 12 years ago

If I do anything that causes the Identify Results dock to appear, such as clicking on the Identify Features or Select single feature buttons, the entire canvas redraws. Seems like a pointless redraw since the dock, in my case, does not change the canvas dimensions when it opens; it just encroaches on the Layers dock.

If I close the Identify Results dock, there's no redraw, but it happens again if I click on one of those buttons.

(from #5087)

#17 Updated by Giovanni Manghi about 12 years ago

  • Tracker changed from 4 to Bug report

#18 Updated by Paolo Cavallini about 12 years ago

  • Target version changed from Version 1.7.4 to Version 1.8.0

#19 Updated by Paolo Cavallini over 11 years ago

  • Target version changed from Version 1.8.0 to Version 2.0.0

#20 Updated by Regis Haubourg over 11 years ago

Another useless redraw: Data is redrawn twice if "option/rendering/feature of feature to draw before updating the display " is set to something different than 0. Not good since this option is really nice to let user be patient for huge datasets, he has to be twice more patient ;-)
Régis

#21 Updated by Paolo Cavallini about 10 years ago

  • Target version changed from Version 2.0.0 to Future Release - High Priority

#22 Updated by Matthias Kuhn almost 10 years ago

  • Status changed from Open to Feedback

Can this topic be closed since MT rendering is implemented?

#23 Updated by Giovanni Manghi almost 10 years ago

  • Operating System deleted (All)
  • Status info deleted (1)

Matthias Kuhn wrote:

Can this topic be closed since MT rendering is implemented?

I see your point, because of MTR the canvas does not block anymore, then a canvas redraw is harmless. I would say that I agree, but useless redraws can still hurt when layers are big (millions of features) and/or projects complex.

I guess that this ticket was too general from the beginning, and we should close this in favor of keeping specific ones like:

#10441
#9676

#24 Updated by Giovanni Manghi over 9 years ago

  • Status changed from Feedback to Closed
  • Resolution set to duplicate

closing in favor of tickets for specific cases.

Also available in: Atom PDF