Skip to content

avoid draw buffer -> display buffer copy #843

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

Merged
merged 1 commit into from
Aug 12, 2016

Conversation

monfera
Copy link
Contributor

@monfera monfera commented Aug 11, 2016

General WebGL speedup (currently done for 2D plots only) that can help low-end platforms such as current MacBook and mobile platforms that have large display buffers (high resolution)

@etpinard
Copy link
Contributor

Hmm. How does this affect to-image exports?

If I recall correctly preserveDrawingBuffer has to be turned on for to-image to work correctly (I might be wrong though).

@monfera
Copy link
Contributor Author

monfera commented Aug 11, 2016

Thanks for highlighting this potential issue. For the record, we decided to check effects and if needed, apply the synchronous export approach which doesn't need preserveDrawingBuffer to be true (buffer isn't cleared yet).

@monfera
Copy link
Contributor Author

monfera commented Aug 11, 2016

... I was curious since further tests showed that Chrome, Safari and FF all seem to export fine with this flag set to false. I believe it's because, for the 2D plots at least (for which this PR applies) there's already an intention to be synchronous:

  1. The render loop is temporarily disabled
  2. There is a single draw call performed synchronously just before the export

With this and as discussed, I'd leave the call with your further investigation and decision. On reasonable hardware this PR doesn't seem mandatory for a decent framerate even with the upcoming pointcloud but probably helps weaker notebooks and mobile.

@etpinard
Copy link
Contributor

After some testing in browsers and in our nw.js image exporter, this PR has no unwanted side-effects.

Merging for perf 💊

Thanks @monfera !

@etpinard etpinard added this to the v1.17.0 milestone Aug 12, 2016
@etpinard etpinard merged commit acff0da into plotly:master Aug 12, 2016
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.

2 participants