mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-12 01:07:57 -06:00
NotificationManager -> Separate notification update from its render to reduce the amount of scene refresh
This commit is contained in:
parent
42a00a32df
commit
bcb2a4884b
4 changed files with 315 additions and 13 deletions
|
@ -1703,7 +1703,7 @@ void GLCanvas3D::render()
|
|||
m_tooltip.render(m_mouse.position, *this);
|
||||
|
||||
wxGetApp().plater()->get_mouse3d_controller().render_settings_dialog(*this);
|
||||
wxGetApp().plater()->get_notification_manager()->render_notifications(get_overlay_window_width());
|
||||
wxGetApp().plater()->get_notification_manager()->render_notifications(get_overlay_window_width());
|
||||
|
||||
wxGetApp().imgui()->render();
|
||||
|
||||
|
@ -2358,6 +2358,14 @@ void GLCanvas3D::on_idle(wxIdleEvent& evt)
|
|||
if (!m_initialized)
|
||||
return;
|
||||
|
||||
#if ENABLE_NEW_NOTIFICATIONS_FADE_OUT
|
||||
NotificationManager* notification_mgr = wxGetApp().plater()->get_notification_manager();
|
||||
if (notification_mgr->requires_update())
|
||||
notification_mgr->update_notifications();
|
||||
|
||||
m_dirty |= notification_mgr->requires_render();
|
||||
#endif // ENABLE_NEW_NOTIFICATIONS_FADE_OUT
|
||||
|
||||
m_dirty |= m_main_toolbar.update_items_state();
|
||||
m_dirty |= m_undoredo_toolbar.update_items_state();
|
||||
m_dirty |= wxGetApp().plater()->get_view_toolbar().update_items_state();
|
||||
|
@ -2365,12 +2373,24 @@ void GLCanvas3D::on_idle(wxIdleEvent& evt)
|
|||
bool mouse3d_controller_applied = wxGetApp().plater()->get_mouse3d_controller().apply(wxGetApp().plater()->get_camera());
|
||||
m_dirty |= mouse3d_controller_applied;
|
||||
|
||||
#if ENABLE_NEW_NOTIFICATIONS_FADE_OUT
|
||||
if (!m_dirty) {
|
||||
if (notification_mgr->requires_update())
|
||||
evt.RequestMore();
|
||||
return;
|
||||
}
|
||||
#else
|
||||
if (!m_dirty)
|
||||
return;
|
||||
#endif // ENABLE_NEW_NOTIFICATIONS_FADE_OUT
|
||||
|
||||
_refresh_if_shown_on_screen();
|
||||
|
||||
#if ENABLE_NEW_NOTIFICATIONS_FADE_OUT
|
||||
if (m_extra_frame_requested || mouse3d_controller_applied || notification_mgr->requires_update()) {
|
||||
#else
|
||||
if (m_extra_frame_requested || mouse3d_controller_applied) {
|
||||
#endif // ENABLE_NEW_NOTIFICATIONS_FADE_OUT
|
||||
m_dirty = true;
|
||||
m_extra_frame_requested = false;
|
||||
evt.RequestMore();
|
||||
|
@ -2505,7 +2525,7 @@ void GLCanvas3D::on_char(wxKeyEvent& evt)
|
|||
case WXK_BACK:
|
||||
case WXK_DELETE:
|
||||
post_event(SimpleEvent(EVT_GLTOOLBAR_DELETE_ALL)); break;
|
||||
default: evt.Skip();
|
||||
default: evt.Skip();
|
||||
}
|
||||
}
|
||||
else if ((evt.GetModifiers() & shiftMask) != 0) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue