Cleanup: rename image undo_tile to paint_tile
authorCampbell Barton <ideasman42@gmail.com>
Tue, 1 Oct 2019 15:54:58 +0000 (01:54 +1000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 1 Oct 2019 16:04:37 +0000 (02:04 +1000)
Clearer because they're no longer the same as undo tiles.

source/blender/editors/include/ED_paint.h
source/blender/editors/sculpt_paint/paint_image.c
source/blender/editors/sculpt_paint/paint_image_2d.c
source/blender/editors/sculpt_paint/paint_image_proj.c
source/blender/editors/space_image/image_undo.c

index 82f5e3b2b57cbc0f9bf80dafac58a74184bcf73a..84f63a5e54ba1c24f31c93797c566f8432883d2a 100644 (file)
@@ -51,32 +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);
+void *ED_image_paint_tile_find(struct ListBase *undo_tiles,
+                               struct Image *ima,
+                               struct ImBuf *ibuf,
+                               int x_tile,
+                               int y_tile,
+                               unsigned short **r_mask,
+                               bool validate);
+void *ED_image_paint_tile_push(struct ListBase *undo_tiles,
+                               struct Image *ima,
+                               struct ImBuf *ibuf,
+                               struct ImBuf **tmpibuf,
+                               int x_tile,
+                               int y_tile,
+                               unsigned short **r_mask,
+                               bool **r_valid,
+                               bool use_thread_lock,
+                               bool find_prev);
+void ED_image_paint_tile_remove_masks_all(void);
+void ED_image_paint_tile_lock_init(void);
+void ED_image_paint_tile_lock_end(void);
 
-struct ListBase *ED_image_undo_get_tiles(void);
+struct ListBase *ED_image_paint_tile_list_get(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)
+#define ED_IMAGE_UNDO_TILE_BITS 6
+#define ED_IMAGE_UNDO_TILE_SIZE (1 << ED_IMAGE_UNDO_TILE_BITS)
+#define ED_IMAGE_UNDO_TILE_NUMBER(size) \
+  (((size) + ED_IMAGE_UNDO_TILE_SIZE - 1) >> ED_IMAGE_UNDO_TILE_BITS)
 
 /* paint_curve_undo.c */
 void ED_paintcurve_undo_push_begin(const char *name);
index 54531139616c1bb088c29747a299c400678168ac..24c2dfb6c6b14e977b3aa82f8de21e0340912d0b 100644 (file)
@@ -113,10 +113,10 @@ void imapaint_region_tiles(
 
   IMB_rectclip(ibuf, NULL, &x, &y, &srcx, &srcy, &w, &h);
 
-  *tw = ((x + w - 1) >> IMAPAINT_TILE_BITS);
-  *th = ((y + h - 1) >> IMAPAINT_TILE_BITS);
-  *tx = (x >> IMAPAINT_TILE_BITS);
-  *ty = (y >> IMAPAINT_TILE_BITS);
+  *tw = ((x + w - 1) >> ED_IMAGE_UNDO_TILE_BITS);
+  *th = ((y + h - 1) >> ED_IMAGE_UNDO_TILE_BITS);
+  *tx = (x >> ED_IMAGE_UNDO_TILE_BITS);
+  *ty = (y >> ED_IMAGE_UNDO_TILE_BITS);
 }
 
 void ED_imapaint_dirty_region(Image *ima, ImBuf *ibuf, int x, int y, int w, int h, bool find_old)
@@ -147,11 +147,12 @@ void ED_imapaint_dirty_region(Image *ima, ImBuf *ibuf, int x, int y, int w, int
 
   imapaint_region_tiles(ibuf, x, y, w, h, &tilex, &tiley, &tilew, &tileh);
 
-  ListBase *undo_tiles = ED_image_undo_get_tiles();
+  ListBase *undo_tiles = ED_image_paint_tile_list_get();
 
   for (ty = tiley; ty <= tileh; ty++) {
     for (tx = tilex; tx <= tilew; tx++) {
-      image_undo_push_tile(undo_tiles, ima, ibuf, &tmpibuf, tx, ty, NULL, NULL, false, find_old);
+      ED_image_paint_tile_push(
+          undo_tiles, ima, ibuf, &tmpibuf, tx, ty, NULL, NULL, false, find_old);
     }
   }
 
index 8f1156295a3a68c53bc71dee8d919e3d9470148b..58ea00d67408eac2da4ba21f5ddc9e8d0093c1a1 100644 (file)
@@ -1197,23 +1197,24 @@ static void paint_2d_do_making_brush(ImagePaintState *s,
                                      int tileh)
 {
   ImBuf tmpbuf;
-  IMB_initImBuf(&tmpbuf, IMAPAINT_TILE_SIZE, IMAPAINT_TILE_SIZE, 32, 0);
+  IMB_initImBuf(&tmpbuf, ED_IMAGE_UNDO_TILE_SIZE, ED_IMAGE_UNDO_TILE_SIZE, 32, 0);
 
-  ListBase *undo_tiles = ED_image_undo_get_tiles();
+  ListBase *undo_tiles = ED_image_paint_tile_list_get();
 
   for (int ty = tiley; ty <= tileh; ty++) {
     for (int tx = tilex; tx <= tilew; tx++) {
       /* retrieve original pixels + mask from undo buffer */
       unsigned short *mask;
-      int origx = region->destx - tx * IMAPAINT_TILE_SIZE;
-      int origy = region->desty - ty * IMAPAINT_TILE_SIZE;
+      int origx = region->destx - tx * ED_IMAGE_UNDO_TILE_SIZE;
+      int origy = region->desty - ty * ED_IMAGE_UNDO_TILE_SIZE;
 
       if (s->canvas->rect_float) {
-        tmpbuf.rect_float = image_undo_find_tile(
+        tmpbuf.rect_float = ED_image_paint_tile_find(
             undo_tiles, s->image, s->canvas, tx, ty, &mask, false);
       }
       else {
-        tmpbuf.rect = image_undo_find_tile(undo_tiles, s->image, s->canvas, tx, ty, &mask, false);
+        tmpbuf.rect = ED_image_paint_tile_find(
+            undo_tiles, s->image, s->canvas, tx, ty, &mask, false);
       }
 
       IMB_rectblend(s->canvas,
@@ -1455,7 +1456,7 @@ static void paint_2d_canvas_free(ImagePaintState *s)
     MEM_freeN(s->blurkernel);
   }
 
-  image_undo_remove_masks();
+  ED_image_paint_tile_remove_masks_all();
 }
 
 void paint_2d_stroke(void *ps,
index 4ec3d4ec70ba723c85897308ea4adbc8c968aef5..756374fab961aeea5ef50cf28385ca35c0df1e2c 100644 (file)
@@ -1807,31 +1807,31 @@ static int project_paint_undo_subtiles(const TileInfo *tinf, int tx, int ty)
   }
 
   if (generate_tile) {
-    ListBase *undo_tiles = ED_image_undo_get_tiles();
+    ListBase *undo_tiles = ED_image_paint_tile_list_get();
     volatile void *undorect;
     if (tinf->masked) {
-      undorect = image_undo_push_tile(undo_tiles,
-                                      pjIma->ima,
-                                      pjIma->ibuf,
-                                      tinf->tmpibuf,
-                                      tx,
-                                      ty,
-                                      &pjIma->maskRect[tile_index],
-                                      &pjIma->valid[tile_index],
-                                      true,
-                                      false);
+      undorect = ED_image_paint_tile_push(undo_tiles,
+                                          pjIma->ima,
+                                          pjIma->ibuf,
+                                          tinf->tmpibuf,
+                                          tx,
+                                          ty,
+                                          &pjIma->maskRect[tile_index],
+                                          &pjIma->valid[tile_index],
+                                          true,
+                                          false);
     }
     else {
-      undorect = image_undo_push_tile(undo_tiles,
-                                      pjIma->ima,
-                                      pjIma->ibuf,
-                                      tinf->tmpibuf,
-                                      tx,
-                                      ty,
-                                      NULL,
-                                      &pjIma->valid[tile_index],
-                                      true,
-                                      false);
+      undorect = ED_image_paint_tile_push(undo_tiles,
+                                          pjIma->ima,
+                                          pjIma->ibuf,
+                                          tinf->tmpibuf,
+                                          tx,
+                                          ty,
+                                          NULL,
+                                          &pjIma->valid[tile_index],
+                                          true,
+                                          false);
     }
 
     BKE_image_mark_dirty(pjIma->ima, pjIma->ibuf);
@@ -1880,14 +1880,14 @@ static ProjPixel *project_paint_uvpixel_init(const ProjPaintState *ps,
 
   /* calculate the undo tile offset of the pixel, used to store the original
    * pixel color and accumulated mask if any */
-  x_tile = x_px >> IMAPAINT_TILE_BITS;
-  y_tile = y_px >> IMAPAINT_TILE_BITS;
+  x_tile = x_px >> ED_IMAGE_UNDO_TILE_BITS;
+  y_tile = y_px >> ED_IMAGE_UNDO_TILE_BITS;
 
-  x_round = x_tile * IMAPAINT_TILE_SIZE;
-  y_round = y_tile * IMAPAINT_TILE_SIZE;
+  x_round = x_tile * ED_IMAGE_UNDO_TILE_SIZE;
+  y_round = y_tile * ED_IMAGE_UNDO_TILE_SIZE;
   // memset(projPixel, 0, size);
 
-  tile_offset = (x_px - x_round) + (y_px - y_round) * IMAPAINT_TILE_SIZE;
+  tile_offset = (x_px - x_round) + (y_px - y_round) * ED_IMAGE_UNDO_TILE_SIZE;
   tile_index = project_paint_undo_subtiles(tinf, x_tile, y_tile);
 
   /* other thread may be initializing the tile so wait here */
@@ -1895,8 +1895,9 @@ static ProjPixel *project_paint_uvpixel_init(const ProjPaintState *ps,
     /* pass */
   }
 
-  BLI_assert(tile_index < (IMAPAINT_TILE_NUMBER(ibuf->x) * IMAPAINT_TILE_NUMBER(ibuf->y)));
-  BLI_assert(tile_offset < (IMAPAINT_TILE_SIZE * IMAPAINT_TILE_SIZE));
+  BLI_assert(tile_index <
+             (ED_IMAGE_UNDO_TILE_NUMBER(ibuf->x) * ED_IMAGE_UNDO_TILE_NUMBER(ibuf->y)));
+  BLI_assert(tile_offset < (ED_IMAGE_UNDO_TILE_SIZE * ED_IMAGE_UNDO_TILE_SIZE));
 
   projPixel->valid = projima->valid[tile_index];
 
@@ -2974,7 +2975,7 @@ static void project_paint_face_init(const ProjPaintState *ps,
   TileInfo tinf = {
       ps->tile_lock,
       ps->do_masking,
-      IMAPAINT_TILE_NUMBER(ibuf->x),
+      ED_IMAGE_UNDO_TILE_NUMBER(ibuf->x),
       tmpibuf,
       ps->projImages + image_index,
   };
@@ -3926,7 +3927,7 @@ static void proj_paint_state_thread_init(ProjPaintState *ps, const bool reset_th
       BLI_spin_init(ps->tile_lock);
     }
 
-    image_undo_init_locks();
+    ED_image_paint_tile_lock_init();
   }
 
   for (a = 0; a < ps->thread_tot; a++) {
@@ -4244,8 +4245,8 @@ static void project_paint_build_proj_ima(ProjPaintState *ps,
     projIma->ima = node->link;
     projIma->touch = 0;
     projIma->ibuf = BKE_image_acquire_ibuf(projIma->ima, NULL, NULL);
-    size = sizeof(void **) * IMAPAINT_TILE_NUMBER(projIma->ibuf->x) *
-           IMAPAINT_TILE_NUMBER(projIma->ibuf->y);
+    size = sizeof(void **) * ED_IMAGE_UNDO_TILE_NUMBER(projIma->ibuf->x) *
+           ED_IMAGE_UNDO_TILE_NUMBER(projIma->ibuf->y);
     projIma->partRedrawRect = BLI_memarena_alloc(
         arena, sizeof(ImagePaintPartialRedraw) * PROJ_BOUNDBOX_SQUARED);
     partial_redraw_array_init(projIma->partRedrawRect);
@@ -4535,7 +4536,7 @@ static void project_paint_end(ProjPaintState *ps)
 {
   int a;
 
-  image_undo_remove_masks();
+  ED_image_paint_tile_remove_masks_all();
 
   /* dereference used image buffers */
   if (ps->is_shared_user == false) {
@@ -4578,7 +4579,7 @@ static void project_paint_end(ProjPaintState *ps)
       MEM_freeN((void *)ps->tile_lock);
     }
 
-    image_undo_end_locks();
+    ED_image_paint_tile_lock_end();
 
 #ifndef PROJ_DEBUG_NOSEAMBLEED
     if (ps->seam_bleed_px > 0.0f) {
index c3d8bd1b446b6d7990a0ac6a8946d41add35d9cb..4ac621d34ff29ded0ebcbddc2ae16e2716efae6e 100644 (file)
@@ -75,12 +75,12 @@ static CLG_LogRef LOG = {"ed.image.undo"};
  * paint operation, but for now just give a public interface */
 static SpinLock paint_tiles_lock;
 
-void image_undo_init_locks(void)
+void ED_image_paint_tile_lock_init(void)
 {
   BLI_spin_init(&paint_tiles_lock);
 }
 
-void image_undo_end_locks(void)
+void ED_image_paint_tile_lock_end(void)
 {
   BLI_spin_end(&paint_tiles_lock);
 }
@@ -99,7 +99,8 @@ void image_undo_end_locks(void)
 
 static ImBuf *imbuf_alloc_temp_tile(void)
 {
-  return IMB_allocImBuf(IMAPAINT_TILE_SIZE, IMAPAINT_TILE_SIZE, 32, IB_rectfloat | IB_rect);
+  return IMB_allocImBuf(
+      ED_IMAGE_UNDO_TILE_SIZE, ED_IMAGE_UNDO_TILE_SIZE, 32, IB_rectfloat | IB_rect);
 }
 
 typedef struct PaintTile {
@@ -141,13 +142,13 @@ static void ptile_invalidate_list(ListBase *paint_tiles)
   }
 }
 
-void *image_undo_find_tile(ListBase *paint_tiles,
-                           Image *image,
-                           ImBuf *ibuf,
-                           int x_tile,
-                           int y_tile,
-                           ushort **r_mask,
-                           bool validate)
+void *ED_image_paint_tile_find(ListBase *paint_tiles,
+                               Image *image,
+                               ImBuf *ibuf,
+                               int x_tile,
+                               int y_tile,
+                               ushort **r_mask,
+                               bool validate)
 {
   for (PaintTile *ptile = paint_tiles->first; ptile; ptile = ptile->next) {
     if (ptile->x == x_tile && ptile->y == y_tile) {
@@ -155,7 +156,7 @@ void *image_undo_find_tile(ListBase *paint_tiles,
         if (r_mask) {
           /* allocate mask if requested. */
           if (!ptile->mask) {
-            ptile->mask = MEM_callocN(sizeof(ushort) * SQUARE(IMAPAINT_TILE_SIZE),
+            ptile->mask = MEM_callocN(sizeof(ushort) * SQUARE(ED_IMAGE_UNDO_TILE_SIZE),
                                       "UndoImageTile.mask");
           }
           *r_mask = ptile->mask;
@@ -170,24 +171,24 @@ void *image_undo_find_tile(ListBase *paint_tiles,
   return NULL;
 }
 
-void image_undo_remove_masks(void)
+void ED_image_paint_tile_remove_masks_all(void)
 {
-  ListBase *paint_tiles = ED_image_undo_get_tiles();
+  ListBase *paint_tiles = ED_image_paint_tile_list_get();
   for (PaintTile *ptile = paint_tiles->first; ptile; ptile = ptile->next) {
     MEM_SAFE_FREE(ptile->mask);
   }
 }
 
-void *image_undo_push_tile(ListBase *paint_tiles,
-                           Image *image,
-                           ImBuf *ibuf,
-                           ImBuf **tmpibuf,
-                           int x_tile,
-                           int y_tile,
-                           ushort **r_mask,
-                           bool **valid,
-                           bool proj,
-                           bool find_prev)
+void *ED_image_paint_tile_push(ListBase *paint_tiles,
+                               Image *image,
+                               ImBuf *ibuf,
+                               ImBuf **tmpibuf,
+                               int x_tile,
+                               int y_tile,
+                               ushort **r_mask,
+                               bool **r_valid,
+                               bool use_thread_lock,
+                               bool find_prev)
 {
   const bool has_float = (ibuf->rect_float != NULL);
 
@@ -195,7 +196,7 @@ void *image_undo_push_tile(ListBase *paint_tiles,
 
   /* in projective painting we keep accounting of tiles, so if we need one pushed, just push! */
   if (find_prev) {
-    void *data = image_undo_find_tile(paint_tiles, image, ibuf, x_tile, y_tile, r_mask, true);
+    void *data = ED_image_paint_tile_find(paint_tiles, image, ibuf, x_tile, y_tile, r_mask, true);
     if (data) {
       return data;
     }
@@ -215,29 +216,29 @@ void *image_undo_push_tile(ListBase *paint_tiles,
 
   /* add mask explicitly here */
   if (r_mask) {
-    *r_mask = ptile->mask = MEM_callocN(sizeof(ushort) * SQUARE(IMAPAINT_TILE_SIZE),
+    *r_mask = ptile->mask = MEM_callocN(sizeof(ushort) * SQUARE(ED_IMAGE_UNDO_TILE_SIZE),
                                         "PaintTile.mask");
   }
 
   ptile->rect.pt = MEM_mapallocN((ibuf->rect_float ? sizeof(float[4]) : sizeof(char[4])) *
-                                     SQUARE(IMAPAINT_TILE_SIZE),
+                                     SQUARE(ED_IMAGE_UNDO_TILE_SIZE),
                                  "PaintTile.rect");
 
   ptile->use_float = has_float;
   ptile->valid = true;
 
-  if (valid) {
-    *valid = &ptile->valid;
+  if (r_valid) {
+    *r_valid = &ptile->valid;
   }
 
   IMB_rectcpy(*tmpibuf,
               ibuf,
               0,
               0,
-              x_tile * IMAPAINT_TILE_SIZE,
-              y_tile * IMAPAINT_TILE_SIZE,
-              IMAPAINT_TILE_SIZE,
-              IMAPAINT_TILE_SIZE);
+              x_tile * ED_IMAGE_UNDO_TILE_SIZE,
+              y_tile * ED_IMAGE_UNDO_TILE_SIZE,
+              ED_IMAGE_UNDO_TILE_SIZE,
+              ED_IMAGE_UNDO_TILE_SIZE);
 
   if (has_float) {
     SWAP(float *, ptile->rect.fp, (*tmpibuf)->rect_float);
@@ -246,12 +247,12 @@ void *image_undo_push_tile(ListBase *paint_tiles,
     SWAP(uint *, ptile->rect.uint, (*tmpibuf)->rect);
   }
 
-  if (proj) {
+  if (use_thread_lock) {
     BLI_spin_lock(&paint_tiles_lock);
   }
   BLI_addtail(paint_tiles, ptile);
 
-  if (proj) {
+  if (use_thread_lock) {
     BLI_spin_unlock(&paint_tiles_lock);
   }
   return ptile->rect.pt;
@@ -273,7 +274,8 @@ static void ptile_restore_runtime_list(ListBase *paint_tiles)
       SWAP(uint *, ptile->rect.uint, tmpibuf->rect);
     }
 
-    IMB_rectcpy(ibuf, tmpibuf, ptile->x, ptile->y, 0, 0, IMAPAINT_TILE_SIZE, IMAPAINT_TILE_SIZE);
+    IMB_rectcpy(
+        ibuf, tmpibuf, ptile->x, ptile->y, 0, 0, ED_IMAGE_UNDO_TILE_SIZE, ED_IMAGE_UNDO_TILE_SIZE);
 
     if (has_float) {
       SWAP(float *, ptile->rect.fp, tmpibuf->rect_float);
@@ -322,10 +324,10 @@ static UndoImageTile *utile_alloc(bool has_float)
 {
   UndoImageTile *utile = MEM_callocN(sizeof(*utile), "ImageUndoTile");
   if (has_float) {
-    utile->rect.fp = MEM_mallocN(sizeof(float[4]) * SQUARE(IMAPAINT_TILE_SIZE), __func__);
+    utile->rect.fp = MEM_mallocN(sizeof(float[4]) * SQUARE(ED_IMAGE_UNDO_TILE_SIZE), __func__);
   }
   else {
-    utile->rect.uint = MEM_mallocN(sizeof(uint) * SQUARE(IMAPAINT_TILE_SIZE), __func__);
+    utile->rect.uint = MEM_mallocN(sizeof(uint) * SQUARE(ED_IMAGE_UNDO_TILE_SIZE), __func__);
   }
   return utile;
 }
@@ -342,7 +344,7 @@ static void utile_init_from_imbuf(
     SWAP(uint *, utile->rect.uint, tmpibuf->rect);
   }
 
-  IMB_rectcpy(tmpibuf, ibuf, 0, 0, x, y, IMAPAINT_TILE_SIZE, IMAPAINT_TILE_SIZE);
+  IMB_rectcpy(tmpibuf, ibuf, 0, 0, x, y, ED_IMAGE_UNDO_TILE_SIZE, ED_IMAGE_UNDO_TILE_SIZE);
 
   if (has_float) {
     SWAP(float *, utile->rect.fp, tmpibuf->rect_float);
@@ -366,7 +368,7 @@ static void utile_restore(
     tmpibuf->rect = utile->rect.uint;
   }
 
-  IMB_rectcpy(ibuf, tmpibuf, x, y, 0, 0, IMAPAINT_TILE_SIZE, IMAPAINT_TILE_SIZE);
+  IMB_rectcpy(ibuf, tmpibuf, x, y, 0, 0, ED_IMAGE_UNDO_TILE_SIZE, ED_IMAGE_UNDO_TILE_SIZE);
 
   tmpibuf->rect_float = prev_rect_float;
   tmpibuf->rect = prev_rect;
@@ -422,8 +424,8 @@ static UndoImageBuf *ubuf_from_image_no_tiles(Image *image, const ImBuf *ibuf)
   ubuf->image_dims[0] = ibuf->x;
   ubuf->image_dims[1] = ibuf->y;
 
-  ubuf->tiles_dims[0] = IMAPAINT_TILE_NUMBER(ubuf->image_dims[0]);
-  ubuf->tiles_dims[1] = IMAPAINT_TILE_NUMBER(ubuf->image_dims[1]);
+  ubuf->tiles_dims[0] = ED_IMAGE_UNDO_TILE_NUMBER(ubuf->image_dims[0]);
+  ubuf->tiles_dims[1] = ED_IMAGE_UNDO_TILE_NUMBER(ubuf->image_dims[1]);
 
   ubuf->tiles_len = ubuf->tiles_dims[0] * ubuf->tiles_dims[1];
   ubuf->tiles = MEM_callocN(sizeof(*ubuf->tiles) * ubuf->tiles_len, __func__);
@@ -443,9 +445,9 @@ static void ubuf_from_image_all_tiles(UndoImageBuf *ubuf, const ImBuf *ibuf)
   const bool has_float = ibuf->rect_float;
   int i = 0;
   for (uint y_tile = 0; y_tile < ubuf->tiles_dims[1]; y_tile += 1) {
-    uint y = y_tile << IMAPAINT_TILE_BITS;
+    uint y = y_tile << ED_IMAGE_UNDO_TILE_BITS;
     for (uint x_tile = 0; x_tile < ubuf->tiles_dims[0]; x_tile += 1) {
-      uint x = x_tile << IMAPAINT_TILE_BITS;
+      uint x = x_tile << ED_IMAGE_UNDO_TILE_BITS;
 
       BLI_assert(ubuf->tiles[i] == NULL);
       UndoImageTile *utile = utile_alloc(has_float);
@@ -516,9 +518,9 @@ static void uhandle_restore_list(ListBase *undo_handles, bool use_init)
       IMB_rect_size_set(ibuf, ubuf->image_dims);
       int i = 0;
       for (uint y_tile = 0; y_tile < ubuf->tiles_dims[1]; y_tile += 1) {
-        uint y = y_tile << IMAPAINT_TILE_BITS;
+        uint y = y_tile << ED_IMAGE_UNDO_TILE_BITS;
         for (uint x_tile = 0; x_tile < ubuf->tiles_dims[0]; x_tile += 1) {
-          uint x = x_tile << IMAPAINT_TILE_BITS;
+          uint x = x_tile << ED_IMAGE_UNDO_TILE_BITS;
           utile_restore(ubuf->tiles[i], x, y, ibuf, tmpibuf);
           changed = true;
           i += 1;
@@ -775,9 +777,9 @@ static bool image_undosys_step_encode(struct bContext *C,
 
           int i = 0;
           for (uint y_tile = 0; y_tile < ubuf_pre->tiles_dims[1]; y_tile += 1) {
-            uint y = y_tile << IMAPAINT_TILE_BITS;
+            uint y = y_tile << ED_IMAGE_UNDO_TILE_BITS;
             for (uint x_tile = 0; x_tile < ubuf_pre->tiles_dims[0]; x_tile += 1) {
-              uint x = x_tile << IMAPAINT_TILE_BITS;
+              uint x = x_tile << ED_IMAGE_UNDO_TILE_BITS;
 
               if ((ubuf_reference != NULL) && ((ubuf_pre->tiles[i] == NULL) ||
                                                /* In this case the paint stroke as has added a tile
@@ -957,7 +959,7 @@ void ED_image_undosys_type(UndoType *ut)
 /** \name Utilities
  * \{ */
 
-ListBase *ED_image_undo_get_tiles(void)
+ListBase *ED_image_paint_tile_list_get(void)
 {
   UndoStack *ustack = ED_undo_stack_get();
   UndoStep *us_prev = ustack->step_init;