Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Rendering] Only render in preview jobs layers that are fast enough #5789

Merged
merged 8 commits into from
Dec 5, 2017

Conversation

nyalldawson
Copy link
Collaborator

Continues the work started by @rouault in #5645, addressing the comments from that thread.

@nirvn
Copy link
Contributor

nirvn commented Dec 2, 2017

Nice. How does it deal with XYZ layers that aren't CPU intensive but might be slow due to connection speed to tile server? Will those also be discarded?

@nyalldawson
Copy link
Collaborator Author

Yes. But the virtual QgsDataProvider::renderInPreview method could be overrided by individual providers to add their own logic which decides whether the layer should be rendered. So XYZ layers could be treated specially and exempt from the time based check.

@nirvn
Copy link
Contributor

nirvn commented Dec 2, 2017

@nyalldawson , excellent.

@m-kuhn
Copy link
Member

m-kuhn commented Dec 2, 2017

Nice to see this back.

So XYZ layers could be treated specially and exempt from the time based check.

Can you remove the "could" in this sentence for tiled sources before merging?

* Returns the render time (in ms) per layer, by layer ID.
* \since QGIS 3.0
*/
QMap< QString, int > layerRenderingTime() const { return mLayerRenderingTime; }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wouldn't perLayerRenderingTime() better reflect that this is not just the time for a single layer. Or layersRenderingTime() ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll change it to perLayerRenderingTime()

@nyalldawson
Copy link
Collaborator Author

Can you remove the "could" in this sentence for tiled sources before merging?

Done

@nirvn
Copy link
Contributor

nirvn commented Dec 4, 2017

@nyalldawson , just compiled and tried this branch, it's a significant improvement, thanks.

@nirvn
Copy link
Contributor

nirvn commented Dec 4, 2017

@nyalldawson , one thing: IMHO, we should render those preview tiles with an opacity < 100%, to clearly indicate those are preview tiles. Now that only a fraction of a project layers are rendered in the preview mode, dragging around can have weird-ish results (for e.g. a hillshade layer that doesn't render in preview tiles). Rendering the preview in say opacity 60% might actually be a nicer UX.

@nyalldawson
Copy link
Collaborator Author

@nirvn

one thing: IMHO, we should render those preview tiles with an opacity < 100%, to clearly indicate those are preview tiles.

Flagged as out-of-scope ;)

@nirvn
Copy link
Contributor

nirvn commented Dec 4, 2017

@nyalldawson , it's a 2-line patch to the QgsMapCanvasItem::paint() function, and look at how much nicer the experience is: https://www.dropbox.com/s/hy9kxfz4a7we800/opacity.mp4?dl=0.

OK to process forward with this? I'll push a PR.

@nyalldawson
Copy link
Collaborator Author

Got a "before" video for comparison?

@nirvn
Copy link
Contributor

nirvn commented Dec 4, 2017

@nyalldawson here: https://www.dropbox.com/s/2cirisb4an64i2o/noopacity.mp4?dl=0

IMHO, it's an improvement. It's a good indication that preview tiles aren't a complete rendering (i.e. until now missing at the very least labels, and thanks to your work CPU-heavy raster/vector datasets).

@nyalldawson
Copy link
Collaborator Author

I'm 50/50 on it. Let's move it to a separate PR for discussion.

@nyalldawson
Copy link
Collaborator Author

@wonder-sk Are you happy with this approach?

@nirvn
Copy link
Contributor

nirvn commented Dec 4, 2017

@nyalldawson , sounds good.

@wonder-sk
Copy link
Member

Looks good to me - thanks! Maybe if the public API would use pointers to QgsMapLayer instead of layer IDs (to get rid of layer IDs from public API) and use QHash instead of QMap, but neither of those is important...

Copy link
Member

@m-kuhn m-kuhn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah!

@nyalldawson nyalldawson deleted the render_jobs branch December 5, 2017 00:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants