From 7aff48add08a875138d3a65c16811c8cb0e5eae1 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 2 Oct 2019 01:44:27 +1000 Subject: Cleanup: move image undo into space_image/ This isn't just used for painting. --- source/blender/editors/include/ED_paint.h | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) (limited to 'source/blender/editors/include/ED_paint.h') diff --git a/source/blender/editors/include/ED_paint.h b/source/blender/editors/include/ED_paint.h index 81252ad2516..82f5e3b2b57 100644 --- a/source/blender/editors/include/ED_paint.h +++ b/source/blender/editors/include/ED_paint.h @@ -40,7 +40,7 @@ void ED_imapaint_dirty_region( struct Image *ima, struct ImBuf *ibuf, int x, int y, int w, int h, bool find_old); void ED_imapaint_bucket_fill(struct bContext *C, float color[3], struct wmOperator *op); -/* paint_image_undo.c */ +/* image_undo.c */ void ED_image_undo_push_begin(const char *name, int paint_mode); void ED_image_undo_push_begin_with_image(const char *name, struct Image *image, @@ -51,6 +51,33 @@ void ED_image_undo_restore(struct UndoStep *us); void ED_image_undosys_type(struct UndoType *ut); +void *image_undo_find_tile(struct ListBase *undo_tiles, + struct Image *ima, + struct ImBuf *ibuf, + int x_tile, + int y_tile, + unsigned short **mask, + bool validate); +void *image_undo_push_tile(struct ListBase *undo_tiles, + struct Image *ima, + struct ImBuf *ibuf, + struct ImBuf **tmpibuf, + int x_tile, + int y_tile, + unsigned short **, + bool **valid, + bool proj, + bool find_prev); +void image_undo_remove_masks(void); +void image_undo_init_locks(void); +void image_undo_end_locks(void); + +struct ListBase *ED_image_undo_get_tiles(void); + +#define IMAPAINT_TILE_BITS 6 +#define IMAPAINT_TILE_SIZE (1 << IMAPAINT_TILE_BITS) +#define IMAPAINT_TILE_NUMBER(size) (((size) + IMAPAINT_TILE_SIZE - 1) >> IMAPAINT_TILE_BITS) + /* paint_curve_undo.c */ void ED_paintcurve_undo_push_begin(const char *name); void ED_paintcurve_undo_push_end(void); -- cgit v1.2.3