Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2021-07-13 10:28:07 +0300
committerCampbell Barton <ideasman42@gmail.com>2021-07-13 12:43:05 +0300
commit1b4d5c7a35597a70411515f721a405416244b540 (patch)
treec37820526209f2968825d3b38a64d82db526342e /source/blender/blenkernel/BKE_undo_system.h
parentf9c9e000ca42c8cc169dec22c702904944ee2513 (diff)
Undo System: avoid redundant decoding on undo
In most cases the undo system was loading undo steps twice. This was needed since some undo systems (sculpt, paint, text) require stepping out of the current undo step. Use a flag to limit this to the undo systems that need it. This improves performance for other undo systems. This gives around 1.96x speedup in edit-mesh for high-poly objects. Reviewed by: mont29 Ref D11893
Diffstat (limited to 'source/blender/blenkernel/BKE_undo_system.h')
-rw-r--r--source/blender/blenkernel/BKE_undo_system.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_undo_system.h b/source/blender/blenkernel/BKE_undo_system.h
index efac5d9097f..2973a432723 100644
--- a/source/blender/blenkernel/BKE_undo_system.h
+++ b/source/blender/blenkernel/BKE_undo_system.h
@@ -162,6 +162,13 @@ typedef enum UndoTypeFlags {
* \note Callback is still supposed to properly deal with a NULL context pointer.
*/
UNDOTYPE_FLAG_NEED_CONTEXT_FOR_ENCODE = 1 << 0,
+
+ /**
+ * When the active undo step is of this type, it must be read before loading other undo steps.
+ *
+ * This is typically used for undo systems that store both before/after states.
+ */
+ UNDOTYPE_FLAG_DECODE_ACTIVE_STEP = 1 << 1,
} UndoTypeFlags;
/* Expose since we need to perform operations on specific undo types (rarely). */