Page MenuHome

Performance: Draw play head as an overlay
ClosedPublic

Authored by Jeroen Bakker (jbakker) on Thu, Jun 18, 4:34 PM.

Details

Summary

When playing back animations a playhead is updated in all the animation editors.
The drawing of the playhead is part of the drawing of the main region RGN_TYPE_WINDOW that redraws the whole region.

This change will draw the play head and window scrollers when updating the screen. This affects the Action editor, Timeline, Graph editor, NLA editor and Sequence editor. There is noticeable speedup when using complex animation files.

Spring 02_020_A.anim.blend fps went from 11.8 to 12.5 when showing a timeline and a action editor on a Ryzen 1700.

This patch relates to D8073 as drawing channel region adds a RGN_DRAW_NO_REBUILD to the RGN_TYPE_WINDOW.

Functional changes

  • When playing back animation the markers don't jump up/down when near the frame. This could be added back.

TODO after commit

  • The NLA editor is redrawn on frame change. But doesn't have to. The cause of this isn't animation playback. it could have been the channel region. Need to retest.
  • Rename region->do_draw_overlay to region->do_draw_paint_cursor to remove naming conflict with draw_overlay

Diff Detail

Repository
rB Blender

Event Timeline

Jeroen Bakker (jbakker) requested review of this revision.Thu, Jun 18, 4:34 PM
Jeroen Bakker (jbakker) created this revision.

drawing of all play heads in an display overlay

Jeroen Bakker (jbakker) retitled this revision from [WIP] Fix T75124: Draw action editor current frame as cursor to Performance: Draw play head as an overlay.Fri, Jun 19, 12:59 PM
Jeroen Bakker (jbakker) edited the summary of this revision. (Show Details)
Jeroen Bakker (jbakker) edited the summary of this revision. (Show Details)

Fixed follow time

Jeroen Bakker (jbakker) planned changes to this revision.Fri, Jun 19, 3:03 PM
This comment was removed by Jeroen Bakker (jbakker).

Updated with latest master

Jeroen Bakker (jbakker) edited the summary of this revision. (Show Details)Fri, Jun 19, 4:18 PM

Seems generally fine.

source/blender/blenkernel/BKE_screen.h
146

This could be named draw_overlay, for consistent terminology with region->do_draw_overlay which has the same purpose.

This term of course has a different meaning in the 3D viewport, but maybe that's ok.

source/blender/windowmanager/intern/wm_draw.c
776–788

Maybe merge this in the paint cursors loop below.

Also for paint cursors there is wmWindowViewport to reset the OpenGL viewport to the whole window. I would guess this is needed for the draw_display case as well.

Brecht Van Lommel (brecht) requested changes to this revision.Fri, Jun 19, 5:19 PM
This revision now requires changes to proceed.Fri, Jun 19, 5:19 PM
Jeroen Bakker (jbakker) marked 2 inline comments as done.

Code review + rebase with master

  • renamed draw_display to draw_overlay
  • merged draw loop with paint cursor.

updated draw_overlay comment

source/blender/blenkernel/BKE_screen.h
146

The region->do_draw_overlay isn't connected with draw_overlay but with draw_paint_cursor. IMO we should rename do_draw_overlay to do_draw_paint_cursor for more consistency in a separate commit.

source/blender/windowmanager/intern/wm_draw.c
776–788

Done, for draw_overlay the wm_region_draw_display resets the window viewport to its original state. Another wmWindowViewport was not needed. This part could be rechecked to reduce gl setup calls that aren't necessary.

Jeroen Bakker (jbakker) edited the summary of this revision. (Show Details)Tue, Jun 23, 8:57 AM
Brecht Van Lommel (brecht) added inline comments.
source/blender/blenkernel/BKE_screen.h
146

Sounds good.

This revision is now accepted and ready to land.Tue, Jun 23, 11:32 AM
This revision was automatically updated to reflect the committed changes.