diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-10-01 18:44:27 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-10-01 18:45:37 +0300 |
commit | 7aff48add08a875138d3a65c16811c8cb0e5eae1 (patch) | |
tree | e9e77912436bc037413803c559a180c9fa9e47d6 /source/blender/editors | |
parent | cc092e9ab0c2e1877fe5d33724c1fdc5fb16b522 (diff) |
Cleanup: move image undo into space_image/
This isn't just used for painting.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/include/ED_paint.h | 29 | ||||
-rw-r--r-- | source/blender/editors/sculpt_paint/CMakeLists.txt | 1 | ||||
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_intern.h | 28 | ||||
-rw-r--r-- | source/blender/editors/space_image/CMakeLists.txt | 2 | ||||
-rw-r--r-- | source/blender/editors/space_image/image_undo.c (renamed from source/blender/editors/sculpt_paint/paint_image_undo.c) | 4 |
5 files changed, 31 insertions, 33 deletions
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); diff --git a/source/blender/editors/sculpt_paint/CMakeLists.txt b/source/blender/editors/sculpt_paint/CMakeLists.txt index c8057686c5e..a5cc262ddcd 100644 --- a/source/blender/editors/sculpt_paint/CMakeLists.txt +++ b/source/blender/editors/sculpt_paint/CMakeLists.txt @@ -48,7 +48,6 @@ set(SRC paint_image.c paint_image_2d.c paint_image_proj.c - paint_image_undo.c paint_mask.c paint_ops.c paint_stroke.c diff --git a/source/blender/editors/sculpt_paint/paint_intern.h b/source/blender/editors/sculpt_paint/paint_intern.h index abfa4331952..69eed84fe2b 100644 --- a/source/blender/editors/sculpt_paint/paint_intern.h +++ b/source/blender/editors/sculpt_paint/paint_intern.h @@ -184,10 +184,6 @@ typedef struct ImagePaintPartialRedraw { int enabled; } ImagePaintPartialRedraw; -#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) - bool image_texture_paint_poll(struct bContext *C); void imapaint_image_update(struct SpaceImage *sima, struct Image *image, @@ -252,30 +248,6 @@ void PAINT_OT_add_texture_paint_slot(struct wmOperatorType *ot); void PAINT_OT_image_paint(struct wmOperatorType *ot); void PAINT_OT_add_simple_uvs(struct wmOperatorType *ot); -/* paint_image_undo.c */ -void *image_undo_find_tile(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(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); - /* sculpt_uv.c */ void SCULPT_OT_uv_sculpt_stroke(struct wmOperatorType *ot); diff --git a/source/blender/editors/space_image/CMakeLists.txt b/source/blender/editors/space_image/CMakeLists.txt index 61e6b065cba..5abcff436f1 100644 --- a/source/blender/editors/space_image/CMakeLists.txt +++ b/source/blender/editors/space_image/CMakeLists.txt @@ -29,6 +29,7 @@ set(INC ../../makesrna ../../render/extern/include ../../windowmanager + ../../../../intern/clog ../../../../intern/glew-mx ../../../../intern/guardedalloc ) @@ -42,6 +43,7 @@ set(SRC image_draw.c image_edit.c image_ops.c + image_undo.c space_image.c image_intern.h diff --git a/source/blender/editors/sculpt_paint/paint_image_undo.c b/source/blender/editors/space_image/image_undo.c index 4cc12296e37..c3d8bd1b446 100644 --- a/source/blender/editors/sculpt_paint/paint_image_undo.c +++ b/source/blender/editors/space_image/image_undo.c @@ -14,7 +14,7 @@ */ /** \file - * \ingroup edsculpt + * \ingroup spimage * * Overview * ======== @@ -64,8 +64,6 @@ #include "WM_api.h" -#include "paint_intern.h" - static CLG_LogRef LOG = {"ed.image.undo"}; /* -------------------------------------------------------------------- */ |