diff options
author | Vojtech Kral <vojtech@kral.hk> | 2018-11-08 17:33:54 +0300 |
---|---|---|
committer | Vojtech Kral <vojtech@kral.hk> | 2018-11-08 17:36:10 +0300 |
commit | 440fbb1e74326ed07c4c5388eddc82f9de7abf2e (patch) | |
tree | 58184fafc62b1458f40e2b1eb2266f684ef580c0 | |
parent | f2836d47382fbc24a624ace592c9d6b6c5168e27 (diff) |
Fix rendering performance on macOS #1250
-rw-r--r-- | xs/src/slic3r/GUI/GLCanvas3D.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/xs/src/slic3r/GUI/GLCanvas3D.cpp b/xs/src/slic3r/GUI/GLCanvas3D.cpp index 062b57b49..ce1c55264 100644 --- a/xs/src/slic3r/GUI/GLCanvas3D.cpp +++ b/xs/src/slic3r/GUI/GLCanvas3D.cpp @@ -3436,8 +3436,14 @@ void GLCanvas3D::_refresh_if_shown_on_screen() { const Size& cnv_size = get_canvas_size(); _resize((unsigned int)cnv_size.get_width(), (unsigned int)cnv_size.get_height()); - if (m_canvas != nullptr) - m_canvas->Refresh(); + + // Because of performance problems on macOS, where PaintEvents are not delivered + // frequently enough, we call render() here directly when we can. + // We can't do that when m_force_zoom_to_bed_enabled == true, because then render() + // ends up calling back here via _force_zoom_to_bed(), causing a stack overflow. + if (m_canvas != nullptr) { + m_force_zoom_to_bed_enabled ? m_canvas->Refresh() : render(); + } } } |