diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2019-12-02 03:40:58 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2019-12-02 03:40:58 +0300 |
commit | a35c635edb3db548e11555024ec3a384f93ce352 (patch) | |
tree | ae0c0c9435c2e7daed4cbd916e0be90df7898b51 /source/blender/depsgraph/intern/eval/deg_eval_runtime_backup_modifier.h | |
parent | 7164e63fefcfa26caf387a2ad04a8c51b533c32b (diff) | |
parent | f1ac64921b49eaea8658d144754a1a532198c720 (diff) |
Merge branch 'master' into tmp-overlay-enginetmp-overlay-engine
# Conflicts:
# source/blender/draw/modes/paint_texture_mode.c
Diffstat (limited to 'source/blender/depsgraph/intern/eval/deg_eval_runtime_backup_modifier.h')
-rw-r--r-- | source/blender/depsgraph/intern/eval/deg_eval_runtime_backup_modifier.h | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/source/blender/depsgraph/intern/eval/deg_eval_runtime_backup_modifier.h b/source/blender/depsgraph/intern/eval/deg_eval_runtime_backup_modifier.h new file mode 100644 index 00000000000..4b3d46126f3 --- /dev/null +++ b/source/blender/depsgraph/intern/eval/deg_eval_runtime_backup_modifier.h @@ -0,0 +1,58 @@ +/* + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * The Original Code is Copyright (C) 2019 Blender Foundation. + * All rights reserved. + */ + +/** \file + * \ingroup depsgraph + */ + +#pragma once + +#include "BKE_modifier.h" + +#include "intern/depsgraph_type.h" + +struct ModifierData; + +namespace DEG { + +struct Depsgraph; + +/* Identifier used to match modifiers to backup/restore their runtime data. + * Identification is happening using original modifier data pointer and the + * modifier type. + * It is not enough to only pointer, since it's possible to have a situation + * when modifier is removed and a new one added, and due to memory allocation + * policy they might have same pointer. + * By adding type into matching we are at least ensuring that modifier will not + * try to interpret runtime data created by another modifier type. */ +class ModifierDataBackupID { + public: + ModifierDataBackupID(const Depsgraph *depsgraph); + ModifierDataBackupID(ModifierData *modifier_data, ModifierType type); + + bool operator<(const ModifierDataBackupID &other) const; + + ModifierData *modifier_data; + ModifierType type; +}; + +/* Storage for backed up runtime modifier data. */ +typedef map<ModifierDataBackupID, void *> ModifierRuntimeDataBackup; + +} // namespace DEG |