forked from bartvdbraak/blender
Minor code cleanup: move some duplicated texpaint code into function
Reviewers: psy-fi Reviewed By: psy-fi Differential Revision: https://developer.blender.org/D1098
This commit is contained in:
parent
2d1e072686
commit
259d47a15e
@ -4343,6 +4343,15 @@ static void do_projectpaint_mask_f(ProjPaintState *ps, ProjPixel *projPixel, flo
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void image_paint_partial_redraw_expand(ImagePaintPartialRedraw *cell,
|
||||||
|
const ProjPixel *projPixel)
|
||||||
|
{
|
||||||
|
cell->x1 = min_ii(cell->x1, (int)projPixel->x_px);
|
||||||
|
cell->y1 = min_ii(cell->y1, (int)projPixel->y_px);
|
||||||
|
|
||||||
|
cell->x2 = max_ii(cell->x2, (int)projPixel->x_px + 1);
|
||||||
|
cell->y2 = max_ii(cell->y2, (int)projPixel->y_px + 1);
|
||||||
|
}
|
||||||
|
|
||||||
/* run this for single and multithreaded painting */
|
/* run this for single and multithreaded painting */
|
||||||
static void *do_projectpaint_thread(void *ph_v)
|
static void *do_projectpaint_thread(void *ph_v)
|
||||||
@ -4496,11 +4505,7 @@ static void *do_projectpaint_thread(void *ph_v)
|
|||||||
}
|
}
|
||||||
|
|
||||||
last_partial_redraw_cell = last_projIma->partRedrawRect + projPixel->bb_cell_index;
|
last_partial_redraw_cell = last_projIma->partRedrawRect + projPixel->bb_cell_index;
|
||||||
last_partial_redraw_cell->x1 = min_ii(last_partial_redraw_cell->x1, (int)projPixel->x_px);
|
image_paint_partial_redraw_expand(last_partial_redraw_cell, projPixel);
|
||||||
last_partial_redraw_cell->y1 = min_ii(last_partial_redraw_cell->y1, (int)projPixel->y_px);
|
|
||||||
|
|
||||||
last_partial_redraw_cell->x2 = max_ii(last_partial_redraw_cell->x2, (int)projPixel->x_px + 1);
|
|
||||||
last_partial_redraw_cell->y2 = max_ii(last_partial_redraw_cell->y2, (int)projPixel->y_px + 1);
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (is_floatbuf) {
|
if (is_floatbuf) {
|
||||||
@ -4634,11 +4639,7 @@ static void *do_projectpaint_thread(void *ph_v)
|
|||||||
*projPixel->valid = true;
|
*projPixel->valid = true;
|
||||||
|
|
||||||
last_partial_redraw_cell = last_projIma->partRedrawRect + projPixel->bb_cell_index;
|
last_partial_redraw_cell = last_projIma->partRedrawRect + projPixel->bb_cell_index;
|
||||||
last_partial_redraw_cell->x1 = min_ii(last_partial_redraw_cell->x1, (int)projPixel->x_px);
|
image_paint_partial_redraw_expand(last_partial_redraw_cell, projPixel);
|
||||||
last_partial_redraw_cell->y1 = min_ii(last_partial_redraw_cell->y1, (int)projPixel->y_px);
|
|
||||||
|
|
||||||
last_partial_redraw_cell->x2 = max_ii(last_partial_redraw_cell->x2, (int)projPixel->x_px + 1);
|
|
||||||
last_partial_redraw_cell->y2 = max_ii(last_partial_redraw_cell->y2, (int)projPixel->y_px + 1);
|
|
||||||
|
|
||||||
/* texrgb is not used for clone, smear or soften */
|
/* texrgb is not used for clone, smear or soften */
|
||||||
switch (tool) {
|
switch (tool) {
|
||||||
|
Loading…
Reference in New Issue
Block a user