Page MenuHome

Skip unnecessary cursor setting
ClosedPublic

Authored by Konrad Puklicki (puklicki) on May 24 2020, 1:43 PM.

Details

Summary

Currently, in sculpting, weight paint and vertex paint modes every cursor movement triggers redraw of a brush. During that redraw, native cursor is set. Under the hood, setting the cursor causes freeing of previous cursor and allocating a new one. In most cases, in previously mentioned modes, recreating cursor is unnecessary since cursor stays the same.

This patch adds a check which skips cursor change if requested cursor is already set. The check could be added in pain_cursor.c, but I felt adding it inside WM_cursor_set function would hopefully skip more unnecessary cursor reallocations.

Diff Detail

Repository
rB Blender

Event Timeline

Konrad Puklicki (puklicki) requested review of this revision.May 24 2020, 1:43 PM
Konrad Puklicki (puklicki) created this revision.
Julian Eisel (Severin) accepted this revision.EditedMay 27 2020, 11:56 AM

Looks just fine, thanks!

This revision is now accepted and ready to land.May 27 2020, 11:56 AM
This revision was automatically updated to reflect the committed changes.