app: replace GimpPaintCore::get_paint_area() by ::get_paint_buffer()
and remove the public TempBuf based get_paint_area() API.
This commit is contained in:
@ -82,10 +82,12 @@ static void gimp_brush_core_interpolate (GimpPaintCore *core,
|
|||||||
GimpPaintOptions *paint_options,
|
GimpPaintOptions *paint_options,
|
||||||
guint32 time);
|
guint32 time);
|
||||||
|
|
||||||
static TempBuf * gimp_brush_core_get_paint_area (GimpPaintCore *paint_core,
|
static GeglBuffer * gimp_brush_core_get_paint_buffer(GimpPaintCore *paint_core,
|
||||||
GimpDrawable *drawable,
|
GimpDrawable *drawable,
|
||||||
GimpPaintOptions *paint_options,
|
GimpPaintOptions *paint_options,
|
||||||
const GimpCoords *coords);
|
const GimpCoords *coords,
|
||||||
|
gint *paint_buffer_x,
|
||||||
|
gint *paint_buffer_y);
|
||||||
|
|
||||||
static void gimp_brush_core_real_set_brush (GimpBrushCore *core,
|
static void gimp_brush_core_real_set_brush (GimpBrushCore *core,
|
||||||
GimpBrush *brush);
|
GimpBrush *brush);
|
||||||
@ -165,7 +167,7 @@ gimp_brush_core_class_init (GimpBrushCoreClass *klass)
|
|||||||
paint_core_class->pre_paint = gimp_brush_core_pre_paint;
|
paint_core_class->pre_paint = gimp_brush_core_pre_paint;
|
||||||
paint_core_class->post_paint = gimp_brush_core_post_paint;
|
paint_core_class->post_paint = gimp_brush_core_post_paint;
|
||||||
paint_core_class->interpolate = gimp_brush_core_interpolate;
|
paint_core_class->interpolate = gimp_brush_core_interpolate;
|
||||||
paint_core_class->get_paint_area = gimp_brush_core_get_paint_area;
|
paint_core_class->get_paint_buffer = gimp_brush_core_get_paint_buffer;
|
||||||
|
|
||||||
klass->handles_changing_brush = FALSE;
|
klass->handles_changing_brush = FALSE;
|
||||||
klass->handles_transforming_brush = TRUE;
|
klass->handles_transforming_brush = TRUE;
|
||||||
@ -786,11 +788,13 @@ gimp_brush_core_interpolate (GimpPaintCore *paint_core,
|
|||||||
paint_core->pixel_dist = pixel_initial + pixel_dist;
|
paint_core->pixel_dist = pixel_initial + pixel_dist;
|
||||||
}
|
}
|
||||||
|
|
||||||
static TempBuf *
|
static GeglBuffer *
|
||||||
gimp_brush_core_get_paint_area (GimpPaintCore *paint_core,
|
gimp_brush_core_get_paint_buffer (GimpPaintCore *paint_core,
|
||||||
GimpDrawable *drawable,
|
GimpDrawable *drawable,
|
||||||
GimpPaintOptions *paint_options,
|
GimpPaintOptions *paint_options,
|
||||||
const GimpCoords *coords)
|
const GimpCoords *coords,
|
||||||
|
gint *paint_buffer_x,
|
||||||
|
gint *paint_buffer_y)
|
||||||
{
|
{
|
||||||
GimpBrushCore *core = GIMP_BRUSH_CORE (paint_core);
|
GimpBrushCore *core = GIMP_BRUSH_CORE (paint_core);
|
||||||
gint x, y;
|
gint x, y;
|
||||||
@ -832,8 +836,8 @@ gimp_brush_core_get_paint_area (GimpPaintCore *paint_core,
|
|||||||
x1, y1,
|
x1, y1,
|
||||||
(x2 - x1), (y2 - y1));
|
(x2 - x1), (y2 - y1));
|
||||||
|
|
||||||
paint_core->paint_buffer_x = x1;
|
*paint_buffer_x = x1;
|
||||||
paint_core->paint_buffer_y = y1;
|
*paint_buffer_y = y1;
|
||||||
|
|
||||||
if (paint_core->paint_buffer)
|
if (paint_core->paint_buffer)
|
||||||
g_object_unref (paint_core->paint_buffer);
|
g_object_unref (paint_core->paint_buffer);
|
||||||
@ -841,7 +845,7 @@ gimp_brush_core_get_paint_area (GimpPaintCore *paint_core,
|
|||||||
paint_core->paint_buffer =
|
paint_core->paint_buffer =
|
||||||
gimp_temp_buf_create_buffer (paint_core->paint_area, format);
|
gimp_temp_buf_create_buffer (paint_core->paint_area, format);
|
||||||
|
|
||||||
return paint_core->paint_area;
|
return paint_core->paint_buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -55,10 +55,12 @@ static void gimp_ink_paint (GimpPaintCore *paint_core,
|
|||||||
const GimpCoords *coords,
|
const GimpCoords *coords,
|
||||||
GimpPaintState paint_state,
|
GimpPaintState paint_state,
|
||||||
guint32 time);
|
guint32 time);
|
||||||
static TempBuf * gimp_ink_get_paint_area (GimpPaintCore *paint_core,
|
static GeglBuffer * gimp_ink_get_paint_buffer (GimpPaintCore *paint_core,
|
||||||
GimpDrawable *drawable,
|
GimpDrawable *drawable,
|
||||||
GimpPaintOptions *paint_options,
|
GimpPaintOptions *paint_options,
|
||||||
const GimpCoords *coords);
|
const GimpCoords *coords,
|
||||||
|
gint *paint_buffer_x,
|
||||||
|
gint *paint_buffer_y);
|
||||||
static GimpUndo * gimp_ink_push_undo (GimpPaintCore *core,
|
static GimpUndo * gimp_ink_push_undo (GimpPaintCore *core,
|
||||||
GimpImage *image,
|
GimpImage *image,
|
||||||
const gchar *undo_desc);
|
const gchar *undo_desc);
|
||||||
@ -107,7 +109,7 @@ gimp_ink_class_init (GimpInkClass *klass)
|
|||||||
object_class->finalize = gimp_ink_finalize;
|
object_class->finalize = gimp_ink_finalize;
|
||||||
|
|
||||||
paint_core_class->paint = gimp_ink_paint;
|
paint_core_class->paint = gimp_ink_paint;
|
||||||
paint_core_class->get_paint_area = gimp_ink_get_paint_area;
|
paint_core_class->get_paint_buffer = gimp_ink_get_paint_buffer;
|
||||||
paint_core_class->push_undo = gimp_ink_push_undo;
|
paint_core_class->push_undo = gimp_ink_push_undo;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -191,11 +193,13 @@ gimp_ink_paint (GimpPaintCore *paint_core,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static TempBuf *
|
static GeglBuffer *
|
||||||
gimp_ink_get_paint_area (GimpPaintCore *paint_core,
|
gimp_ink_get_paint_buffer (GimpPaintCore *paint_core,
|
||||||
GimpDrawable *drawable,
|
GimpDrawable *drawable,
|
||||||
GimpPaintOptions *paint_options,
|
GimpPaintOptions *paint_options,
|
||||||
const GimpCoords *coords)
|
const GimpCoords *coords,
|
||||||
|
gint *paint_buffer_x,
|
||||||
|
gint *paint_buffer_y)
|
||||||
{
|
{
|
||||||
GimpInk *ink = GIMP_INK (paint_core);
|
GimpInk *ink = GIMP_INK (paint_core);
|
||||||
gint x, y;
|
gint x, y;
|
||||||
@ -223,8 +227,8 @@ gimp_ink_get_paint_area (GimpPaintCore *paint_core,
|
|||||||
x1, y1,
|
x1, y1,
|
||||||
(x2 - x1), (y2 - y1));
|
(x2 - x1), (y2 - y1));
|
||||||
|
|
||||||
paint_core->paint_buffer_x = x1;
|
*paint_buffer_x = x1;
|
||||||
paint_core->paint_buffer_y = y1;
|
*paint_buffer_y = y1;
|
||||||
|
|
||||||
if (paint_core->paint_buffer)
|
if (paint_core->paint_buffer)
|
||||||
g_object_unref (paint_core->paint_buffer);
|
g_object_unref (paint_core->paint_buffer);
|
||||||
@ -232,7 +236,7 @@ gimp_ink_get_paint_area (GimpPaintCore *paint_core,
|
|||||||
paint_core->paint_buffer =
|
paint_core->paint_buffer =
|
||||||
gimp_temp_buf_create_buffer (paint_core->paint_area, format);
|
gimp_temp_buf_create_buffer (paint_core->paint_area, format);
|
||||||
|
|
||||||
return paint_core->paint_area;
|
return paint_core->paint_buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -95,10 +95,13 @@ static void gimp_paint_core_real_interpolate (GimpPaintCore *core,
|
|||||||
GimpDrawable *drawable,
|
GimpDrawable *drawable,
|
||||||
GimpPaintOptions *options,
|
GimpPaintOptions *options,
|
||||||
guint32 time);
|
guint32 time);
|
||||||
static TempBuf * gimp_paint_core_real_get_paint_area (GimpPaintCore *core,
|
static GeglBuffer *
|
||||||
|
gimp_paint_core_real_get_paint_buffer (GimpPaintCore *core,
|
||||||
GimpDrawable *drawable,
|
GimpDrawable *drawable,
|
||||||
GimpPaintOptions *options,
|
GimpPaintOptions *options,
|
||||||
const GimpCoords *coords);
|
const GimpCoords *coords,
|
||||||
|
gint *paint_buffer_x,
|
||||||
|
gint *paint_buffer_y);
|
||||||
static GimpUndo* gimp_paint_core_real_push_undo (GimpPaintCore *core,
|
static GimpUndo* gimp_paint_core_real_push_undo (GimpPaintCore *core,
|
||||||
GimpImage *image,
|
GimpImage *image,
|
||||||
const gchar *undo_desc);
|
const gchar *undo_desc);
|
||||||
@ -133,7 +136,7 @@ gimp_paint_core_class_init (GimpPaintCoreClass *klass)
|
|||||||
klass->paint = gimp_paint_core_real_paint;
|
klass->paint = gimp_paint_core_real_paint;
|
||||||
klass->post_paint = gimp_paint_core_real_post_paint;
|
klass->post_paint = gimp_paint_core_real_post_paint;
|
||||||
klass->interpolate = gimp_paint_core_real_interpolate;
|
klass->interpolate = gimp_paint_core_real_interpolate;
|
||||||
klass->get_paint_area = gimp_paint_core_real_get_paint_area;
|
klass->get_paint_buffer = gimp_paint_core_real_get_paint_buffer;
|
||||||
klass->push_undo = gimp_paint_core_real_push_undo;
|
klass->push_undo = gimp_paint_core_real_push_undo;
|
||||||
|
|
||||||
g_object_class_install_property (object_class, PROP_UNDO_DESC,
|
g_object_class_install_property (object_class, PROP_UNDO_DESC,
|
||||||
@ -260,11 +263,13 @@ gimp_paint_core_real_interpolate (GimpPaintCore *core,
|
|||||||
core->last_coords = core->cur_coords;
|
core->last_coords = core->cur_coords;
|
||||||
}
|
}
|
||||||
|
|
||||||
static TempBuf *
|
static GeglBuffer *
|
||||||
gimp_paint_core_real_get_paint_area (GimpPaintCore *core,
|
gimp_paint_core_real_get_paint_buffer (GimpPaintCore *core,
|
||||||
GimpDrawable *drawable,
|
GimpDrawable *drawable,
|
||||||
GimpPaintOptions *paint_options,
|
GimpPaintOptions *paint_options,
|
||||||
const GimpCoords *coords)
|
const GimpCoords *coords,
|
||||||
|
gint *paint_buffer_x,
|
||||||
|
gint *paint_buffer_y)
|
||||||
{
|
{
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@ -660,23 +665,6 @@ gimp_paint_core_round_line (GimpPaintCore *core,
|
|||||||
|
|
||||||
/* protected functions */
|
/* protected functions */
|
||||||
|
|
||||||
TempBuf *
|
|
||||||
gimp_paint_core_get_paint_area (GimpPaintCore *core,
|
|
||||||
GimpDrawable *drawable,
|
|
||||||
GimpPaintOptions *paint_options,
|
|
||||||
const GimpCoords *coords)
|
|
||||||
{
|
|
||||||
g_return_val_if_fail (GIMP_IS_PAINT_CORE (core), NULL);
|
|
||||||
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), NULL);
|
|
||||||
g_return_val_if_fail (gimp_item_is_attached (GIMP_ITEM (drawable)), NULL);
|
|
||||||
g_return_val_if_fail (GIMP_IS_PAINT_OPTIONS (paint_options), NULL);
|
|
||||||
g_return_val_if_fail (coords != NULL, NULL);
|
|
||||||
|
|
||||||
return GIMP_PAINT_CORE_GET_CLASS (core)->get_paint_area (core, drawable,
|
|
||||||
paint_options,
|
|
||||||
coords);
|
|
||||||
}
|
|
||||||
|
|
||||||
GeglBuffer *
|
GeglBuffer *
|
||||||
gimp_paint_core_get_paint_buffer (GimpPaintCore *core,
|
gimp_paint_core_get_paint_buffer (GimpPaintCore *core,
|
||||||
GimpDrawable *drawable,
|
GimpDrawable *drawable,
|
||||||
@ -685,6 +673,8 @@ gimp_paint_core_get_paint_buffer (GimpPaintCore *core,
|
|||||||
gint *paint_buffer_x,
|
gint *paint_buffer_x,
|
||||||
gint *paint_buffer_y)
|
gint *paint_buffer_y)
|
||||||
{
|
{
|
||||||
|
GeglBuffer *paint_buffer;
|
||||||
|
|
||||||
g_return_val_if_fail (GIMP_IS_PAINT_CORE (core), NULL);
|
g_return_val_if_fail (GIMP_IS_PAINT_CORE (core), NULL);
|
||||||
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), NULL);
|
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), NULL);
|
||||||
g_return_val_if_fail (gimp_item_is_attached (GIMP_ITEM (drawable)), NULL);
|
g_return_val_if_fail (gimp_item_is_attached (GIMP_ITEM (drawable)), NULL);
|
||||||
@ -693,15 +683,17 @@ gimp_paint_core_get_paint_buffer (GimpPaintCore *core,
|
|||||||
g_return_val_if_fail (paint_buffer_x != NULL, NULL);
|
g_return_val_if_fail (paint_buffer_x != NULL, NULL);
|
||||||
g_return_val_if_fail (paint_buffer_y != NULL, NULL);
|
g_return_val_if_fail (paint_buffer_y != NULL, NULL);
|
||||||
|
|
||||||
if (gimp_paint_core_get_paint_area (core, drawable, paint_options, coords))
|
paint_buffer =
|
||||||
{
|
GIMP_PAINT_CORE_GET_CLASS (core)->get_paint_buffer (core, drawable,
|
||||||
*paint_buffer_x = core->paint_buffer_x;
|
paint_options,
|
||||||
*paint_buffer_y = core->paint_buffer_y;
|
coords,
|
||||||
|
paint_buffer_x,
|
||||||
|
paint_buffer_y);
|
||||||
|
|
||||||
return core->paint_buffer;
|
core->paint_buffer_x = *paint_buffer_x;
|
||||||
}
|
core->paint_buffer_y = *paint_buffer_y;
|
||||||
|
|
||||||
return NULL;
|
return paint_buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
GeglBuffer *
|
GeglBuffer *
|
||||||
|
@ -100,10 +100,12 @@ struct _GimpPaintCoreClass
|
|||||||
GimpPaintOptions *paint_options,
|
GimpPaintOptions *paint_options,
|
||||||
guint32 time);
|
guint32 time);
|
||||||
|
|
||||||
TempBuf * (* get_paint_area) (GimpPaintCore *core,
|
GeglBuffer * (* get_paint_buffer) (GimpPaintCore *core,
|
||||||
GimpDrawable *drawable,
|
GimpDrawable *drawable,
|
||||||
GimpPaintOptions *paint_options,
|
GimpPaintOptions *paint_options,
|
||||||
const GimpCoords *coords);
|
const GimpCoords *coords,
|
||||||
|
gint *paint_buffer_x,
|
||||||
|
gint *paint_buffer_y);
|
||||||
|
|
||||||
GimpUndo * (* push_undo) (GimpPaintCore *core,
|
GimpUndo * (* push_undo) (GimpPaintCore *core,
|
||||||
GimpImage *image,
|
GimpImage *image,
|
||||||
@ -154,10 +156,6 @@ void gimp_paint_core_round_line (GimpPaintCore *core,
|
|||||||
|
|
||||||
/* protected functions */
|
/* protected functions */
|
||||||
|
|
||||||
TempBuf * gimp_paint_core_get_paint_area (GimpPaintCore *core,
|
|
||||||
GimpDrawable *drawable,
|
|
||||||
GimpPaintOptions *options,
|
|
||||||
const GimpCoords *coords);
|
|
||||||
GeglBuffer * gimp_paint_core_get_paint_buffer (GimpPaintCore *core,
|
GeglBuffer * gimp_paint_core_get_paint_buffer (GimpPaintCore *core,
|
||||||
GimpDrawable *drawable,
|
GimpDrawable *drawable,
|
||||||
GimpPaintOptions *options,
|
GimpPaintOptions *options,
|
||||||
|
Reference in New Issue
Block a user