diff options
author | Alex Parker <zanders3> | 2022-07-25 08:56:17 +0300 |
---|---|---|
committer | Jeroen Bakker <jeroen@blender.org> | 2022-07-25 09:14:32 +0300 |
commit | 44258b5ad0737140d7d1026cc540e3f94ea05566 (patch) | |
tree | e84ca6efd3946df7397eec8f6e582a3cc76386bc /source/blender/editors/sculpt_paint/paint_image_2d.c | |
parent | 7808ee9bd73d7eb286d52ff5a28592dfffbccf40 (diff) |
Undo: Improve image undo performance
When texture painting a lot of time is spent in ED_image_paint_tile_find.
This fixes stores the PaintTiles in a blender::Map making ED_image_paint_tile_find an O(1) rather than O(n) operation.
When using threading the locking should happen during read as well,
still this gives a boost in performance as the read is now much faster.
Reviewed By: jbakker
Maniphest Tasks: T99546
Differential Revision: https://developer.blender.org/D15415
Diffstat (limited to 'source/blender/editors/sculpt_paint/paint_image_2d.c')
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_image_2d.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_image_2d.c b/source/blender/editors/sculpt_paint/paint_image_2d.c index fae2e6863fa..5df65e596b9 100644 --- a/source/blender/editors/sculpt_paint/paint_image_2d.c +++ b/source/blender/editors/sculpt_paint/paint_image_2d.c @@ -1196,7 +1196,7 @@ static void paint_2d_do_making_brush(ImagePaintState *s, ImBuf tmpbuf; IMB_initImBuf(&tmpbuf, ED_IMAGE_UNDO_TILE_SIZE, ED_IMAGE_UNDO_TILE_SIZE, 32, 0); - ListBase *undo_tiles = ED_image_paint_tile_list_get(); + PaintTileMap *undo_tiles = ED_image_paint_tile_map_get(); for (int ty = tiley; ty <= tileh; ty++) { for (int tx = tilex; tx <= tilew; tx++) { |