[Bf-blender-cvs] [2e16fbb] soc-2013-paint: xrg feedback bugfix series #1:

Antony Riakiotakis noreply at git.blender.org
Sat May 24 14:27:30 CEST 2014


Commit: 2e16fbbe04a95e475283e271ee033798a21d1980
Author: Antony Riakiotakis
Date:   Sat May 24 13:08:45 2014 +0300
https://developer.blender.org/rB2e16fbbe04a95e475283e271ee033798a21d1980

xrg feedback bugfix series #1:

Fill tool does not utilize blend modes.

===================================================================

M	source/blender/editors/sculpt_paint/paint_image_2d.c
M	source/blender/editors/sculpt_paint/paint_image_proj.c

===================================================================

diff --git a/source/blender/editors/sculpt_paint/paint_image_2d.c b/source/blender/editors/sculpt_paint/paint_image_2d.c
index d6b5e3c..6ab4146 100644
--- a/source/blender/editors/sculpt_paint/paint_image_2d.c
+++ b/source/blender/editors/sculpt_paint/paint_image_2d.c
@@ -1444,8 +1444,9 @@ void paint_2d_bucket_fill (const bContext *C, float color[3], Brush *br, float m
 			while (!BLI_gsqueue_is_empty(stack)) {
 				BLI_gsqueue_pop(stack, &coordinate);
 
-				blend_color_mix_float(ibuf->rect_float + 4 * (coordinate),
-					                      ibuf->rect_float + 4 * (coordinate), color_f);
+				IMB_blend_color_float(ibuf->rect_float + 4 * (coordinate),
+				                      ibuf->rect_float + 4 * (coordinate),
+				                      color_f, br->blend);
 
 				/* reconstruct the coordinates here */
 				i = coordinate % width;
@@ -1474,8 +1475,9 @@ void paint_2d_bucket_fill (const bContext *C, float color[3], Brush *br, float m
 			while (!BLI_gsqueue_is_empty(stack)) {
 				BLI_gsqueue_pop(stack, &coordinate);
 
-				blend_color_mix_byte((unsigned char *)(ibuf->rect + coordinate),
-					                     (unsigned char *)(ibuf->rect + coordinate), (unsigned char *)&color_b);
+				IMB_blend_color_byte((unsigned char *)(ibuf->rect + coordinate),
+				                     (unsigned char *)(ibuf->rect + coordinate),
+				                     (unsigned char *)&color_b, br->blend);
 
 				/* reconstruct the coordinates here */
 				i = coordinate % width;
@@ -1579,9 +1581,9 @@ void paint_2d_gradient_fill (const bContext *C, Brush *br, float mouse_init[2],
 				/* convert to premultiplied */
 				mul_v3_fl(color_f, color_f[3]);
 				color_f[3] *= br->alpha;
-				blend_color_mix_float(ibuf->rect_float + 4 * (j * ibuf->x + i),
+				IMB_blend_color_float(ibuf->rect_float + 4 * (j * ibuf->x + i),
 				                      ibuf->rect_float + 4 * (j * ibuf->x + i),
-				                      color_f);
+				                      color_f, br->blend);
 			}
 		}
 	}
@@ -1607,9 +1609,9 @@ void paint_2d_gradient_fill (const bContext *C, Brush *br, float mouse_init[2],
 				do_colorband(br->gradient, f, color_f);
 				rgba_float_to_uchar((unsigned char *)&color_b, color_f);
 				((unsigned char *)&color_b)[3] *= br->alpha;
-				blend_color_mix_byte((unsigned char *)(ibuf->rect + j * ibuf->x + i),
+				IMB_blend_color_byte((unsigned char *)(ibuf->rect + j * ibuf->x + i),
 				                     (unsigned char *)(ibuf->rect + j * ibuf->x + i),
-				                     (unsigned char *)&color_b);
+				                     (unsigned char *)&color_b, br->blend);
 			}
 		}
 	}
diff --git a/source/blender/editors/sculpt_paint/paint_image_proj.c b/source/blender/editors/sculpt_paint/paint_image_proj.c
index df0fb92..2b46c93 100644
--- a/source/blender/editors/sculpt_paint/paint_image_proj.c
+++ b/source/blender/editors/sculpt_paint/paint_image_proj.c
@@ -4030,13 +4030,13 @@ static void *do_projectpaint_thread(void *ph_v)
 						if (is_floatbuf) {
 							/* convert to premultipied */
 							mul_v3_fl(color_f, color_f[3]);
-							blend_color_mix_float(projPixel->pixel.f_pt,  projPixel->origColor.f_pt,
-							                      color_f);
+							IMB_blend_color_float(projPixel->pixel.f_pt,  projPixel->origColor.f_pt,
+							                      color_f, ps->blend);
 						}
 						else {
 							rgba_float_to_uchar(projPixel->newColor.ch, color_f);
-							blend_color_mix_byte(projPixel->pixel.ch_pt,  projPixel->origColor.ch_pt,
-							                     projPixel->newColor.ch);
+							IMB_blend_color_byte(projPixel->pixel.ch_pt,  projPixel->origColor.ch_pt,
+							                     projPixel->newColor.ch, ps->blend);
 						}
 					}
 					else {
@@ -4045,16 +4045,16 @@ static void *do_projectpaint_thread(void *ph_v)
 							newColor_f[3] = ((float)projPixel->mask) * (1.0f / 65535.0f) * brush->alpha;
 							copy_v3_v3(newColor_f, ps->paint_color_linear);
 
-							blend_color_mix_float(projPixel->pixel.f_pt,  projPixel->origColor.f_pt,
-							                      newColor_f);
+							IMB_blend_color_float(projPixel->pixel.f_pt,  projPixel->origColor.f_pt,
+							                      newColor_f, ps->blend);
 						}
 						else {
 							float mask = ((float)projPixel->mask) * (1.0f / 65535.0f);
 							projPixel->newColor.ch[3] = mask * 255 * brush->alpha;
 
 							rgb_float_to_uchar(projPixel->newColor.ch, ps->paint_color);
-							blend_color_mix_byte(projPixel->pixel.ch_pt,  projPixel->origColor.ch_pt,
-							                     projPixel->newColor.ch);
+							IMB_blend_color_byte(projPixel->pixel.ch_pt,  projPixel->origColor.ch_pt,
+							                     projPixel->newColor.ch, ps->blend);
 						}
 					}




More information about the Bf-blender-cvs mailing list