Commit 2716d25d authored by Martin Nordholts's avatar Martin Nordholts

Rename brush stuff with 'scale' to 'transform'.

Applied patch from Alexia Death that prepares brushes for
arbitrary transforms by renaming stuff with 'scale' to
'transform'. Takes us one step closer to fixing bug #520078.

* app/core/gimpbrush.[ch]
* app/core/gimpbrushgenerated.c
* app/paint/gimpbrushcore.[ch]
* app/paint/gimpsmudge.c

* app/core/gimpbrush-transform.[ch]: New names of
* app/core/gimpbrush-scale.[ch]

* app/core/Makefile.am: Update.

svn path=/trunk/; revision=27975
parent 431cb58e
2009-02-01 Martin Nordholts <martinn@svn.gnome.org>
Applied patch from Alexia Death that prepares brushes for
arbitrary transforms by renaming stuff with 'scale' to
'transform'. Takes us one step closer to fixing bug #520078.
* app/core/gimpbrush.[ch]
* app/core/gimpbrushgenerated.c
* app/paint/gimpbrushcore.[ch]
* app/paint/gimpsmudge.c
* app/core/gimpbrush-transform.[ch]: New names of
* app/core/gimpbrush-scale.[ch]
* app/core/Makefile.am: Update.
2009-02-01 Martin Nordholts <martinn@svn.gnome.org> 2009-02-01 Martin Nordholts <martinn@svn.gnome.org>
* app/core/gimplayer.[ch]: Add const qualifier to * app/core/gimplayer.[ch]: Add const qualifier to
......
...@@ -54,8 +54,8 @@ libappcore_a_sources = \ ...@@ -54,8 +54,8 @@ libappcore_a_sources = \
gimpbrush-header.h \ gimpbrush-header.h \
gimpbrush-load.c \ gimpbrush-load.c \
gimpbrush-load.h \ gimpbrush-load.h \
gimpbrush-scale.c \ gimpbrush-transform.c \
gimpbrush-scale.h \ gimpbrush-transform.h \
gimpbrushclipboard.c \ gimpbrushclipboard.c \
gimpbrushclipboard.h \ gimpbrushclipboard.h \
gimpbrushgenerated.c \ gimpbrushgenerated.c \
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
#include "core-types.h" #include "core-types.h"
#include "gimpbrush.h" #include "gimpbrush.h"
#include "gimpbrush-scale.h" #include "gimpbrush-transform.h"
#include "base/pixel-region.h" #include "base/pixel-region.h"
#include "base/temp-buf.h" #include "base/temp-buf.h"
...@@ -48,30 +48,30 @@ static TempBuf * gimp_brush_scale_pixmap_down (TempBuf *pixmap, ...@@ -48,30 +48,30 @@ static TempBuf * gimp_brush_scale_pixmap_down (TempBuf *pixmap,
/* public functions */ /* public functions */
void void
gimp_brush_real_scale_size (GimpBrush *brush, gimp_brush_real_transform_size (GimpBrush *brush,
gdouble scale, gdouble scale,
gint *width, gint *width,
gint *height) gint *height)
{ {
*width = (gint) (brush->mask->width * scale + 0.5); *width = (gint) (brush->mask->width * scale + 0.5);
*height = (gint) (brush->mask->height * scale + 0.5); *height = (gint) (brush->mask->height * scale + 0.5);
} }
TempBuf * TempBuf *
gimp_brush_real_scale_mask (GimpBrush *brush, gimp_brush_real_transform_mask (GimpBrush *brush,
gdouble scale) gdouble scale)
{ {
gint dest_width; gint dest_width;
gint dest_height; gint dest_height;
gimp_brush_scale_size (brush, scale, &dest_width, &dest_height); gimp_brush_transform_size (brush, scale, &dest_width, &dest_height);
if (dest_width <= 0 || dest_height <= 0) if (dest_width <= 0 || dest_height <= 0)
return NULL; return NULL;
if (scale <= 1.0) if (scale <= 1.0)
{ {
/* Downscaling with brush_scale_mask is much faster than with /* Downscaling with brush_transform_mask is much faster than with
* gimp_brush_scale_buf. * gimp_brush_scale_buf.
*/ */
return gimp_brush_scale_mask_down (brush->mask, return gimp_brush_scale_mask_down (brush->mask,
...@@ -82,13 +82,13 @@ gimp_brush_real_scale_mask (GimpBrush *brush, ...@@ -82,13 +82,13 @@ gimp_brush_real_scale_mask (GimpBrush *brush,
} }
TempBuf * TempBuf *
gimp_brush_real_scale_pixmap (GimpBrush *brush, gimp_brush_real_transform_pixmap (GimpBrush *brush,
gdouble scale) gdouble scale)
{ {
gint dest_width; gint dest_width;
gint dest_height; gint dest_height;
gimp_brush_scale_size (brush, scale, &dest_width, &dest_height); gimp_brush_transform_size (brush, scale, &dest_width, &dest_height);
if (dest_width <= 0 || dest_height <= 0) if (dest_width <= 0 || dest_height <= 0)
return NULL; return NULL;
......
...@@ -23,14 +23,14 @@ ...@@ -23,14 +23,14 @@
/* virtual functions of GimpBrush, don't call directly */ /* virtual functions of GimpBrush, don't call directly */
void gimp_brush_real_scale_size (GimpBrush *brush, void gimp_brush_real_transform_size (GimpBrush *brush,
gdouble scale, gdouble scale,
gint *scaled_width, gint *scaled_width,
gint *scaled_height); gint *scaled_height);
TempBuf * gimp_brush_real_scale_mask (GimpBrush *brush, TempBuf * gimp_brush_real_transform_mask (GimpBrush *brush,
gdouble scale); gdouble scale);
TempBuf * gimp_brush_real_scale_pixmap (GimpBrush *brush, TempBuf * gimp_brush_real_transform_pixmap (GimpBrush *brush,
gdouble scale); gdouble scale);
#endif /* __GIMP_BRUSH_SCALE_H__ */ #endif /* __GIMP_BRUSH_SCALE_H__ */
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
#include "gimpbrush.h" #include "gimpbrush.h"
#include "gimpbrush-load.h" #include "gimpbrush-load.h"
#include "gimpbrush-scale.h" #include "gimpbrush-transform.h"
#include "gimpbrushgenerated.h" #include "gimpbrushgenerated.h"
#include "gimpmarshal.h" #include "gimpmarshal.h"
#include "gimptagged.h" #include "gimptagged.h"
...@@ -126,9 +126,9 @@ gimp_brush_class_init (GimpBrushClass *klass) ...@@ -126,9 +126,9 @@ gimp_brush_class_init (GimpBrushClass *klass)
klass->select_brush = gimp_brush_real_select_brush; klass->select_brush = gimp_brush_real_select_brush;
klass->want_null_motion = gimp_brush_real_want_null_motion; klass->want_null_motion = gimp_brush_real_want_null_motion;
klass->scale_size = gimp_brush_real_scale_size; klass->transform_size = gimp_brush_real_transform_size;
klass->scale_mask = gimp_brush_real_scale_mask; klass->transform_mask = gimp_brush_real_transform_mask;
klass->scale_pixmap = gimp_brush_real_scale_pixmap; klass->transform_pixmap = gimp_brush_real_transform_pixmap;
klass->spacing_changed = NULL; klass->spacing_changed = NULL;
g_object_class_install_property (object_class, PROP_SPACING, g_object_class_install_property (object_class, PROP_SPACING,
...@@ -276,13 +276,13 @@ gimp_brush_get_new_preview (GimpViewable *viewable, ...@@ -276,13 +276,13 @@ gimp_brush_get_new_preview (GimpViewable *viewable,
if (scale != 1.0) if (scale != 1.0)
{ {
mask_buf = gimp_brush_scale_mask (brush, scale); mask_buf = gimp_brush_transform_mask (brush, scale);
if (! mask_buf) if (! mask_buf)
mask_buf = temp_buf_new (1, 1, 1, 0, 0, transp); mask_buf = temp_buf_new (1, 1, 1, 0, 0, transp);
if (pixmap_buf) if (pixmap_buf)
pixmap_buf = gimp_brush_scale_pixmap (brush, scale); pixmap_buf = gimp_brush_transform_pixmap (brush, scale);
mask_width = mask_buf->width; mask_width = mask_buf->width;
mask_height = mask_buf->height; mask_height = mask_buf->height;
...@@ -456,10 +456,10 @@ gimp_brush_want_null_motion (GimpBrush *brush, ...@@ -456,10 +456,10 @@ gimp_brush_want_null_motion (GimpBrush *brush,
} }
void void
gimp_brush_scale_size (GimpBrush *brush, gimp_brush_transform_size (GimpBrush *brush,
gdouble scale, gdouble scale,
gint *width, gint *width,
gint *height) gint *height)
{ {
g_return_if_fail (GIMP_IS_BRUSH (brush)); g_return_if_fail (GIMP_IS_BRUSH (brush));
g_return_if_fail (scale > 0.0); g_return_if_fail (scale > 0.0);
...@@ -474,12 +474,12 @@ gimp_brush_scale_size (GimpBrush *brush, ...@@ -474,12 +474,12 @@ gimp_brush_scale_size (GimpBrush *brush,
return; return;
} }
GIMP_BRUSH_GET_CLASS (brush)->scale_size (brush, scale, width, height); GIMP_BRUSH_GET_CLASS (brush)->transform_size (brush, scale, width, height);
} }
TempBuf * TempBuf *
gimp_brush_scale_mask (GimpBrush *brush, gimp_brush_transform_mask (GimpBrush *brush,
gdouble scale) gdouble scale)
{ {
g_return_val_if_fail (GIMP_IS_BRUSH (brush), NULL); g_return_val_if_fail (GIMP_IS_BRUSH (brush), NULL);
g_return_val_if_fail (scale > 0.0, NULL); g_return_val_if_fail (scale > 0.0, NULL);
...@@ -487,12 +487,12 @@ gimp_brush_scale_mask (GimpBrush *brush, ...@@ -487,12 +487,12 @@ gimp_brush_scale_mask (GimpBrush *brush,
if (scale == 1.0) if (scale == 1.0)
return temp_buf_copy (brush->mask, NULL); return temp_buf_copy (brush->mask, NULL);
return GIMP_BRUSH_GET_CLASS (brush)->scale_mask (brush, scale); return GIMP_BRUSH_GET_CLASS (brush)->transform_mask (brush, scale);
} }
TempBuf * TempBuf *
gimp_brush_scale_pixmap (GimpBrush *brush, gimp_brush_transform_pixmap (GimpBrush *brush,
gdouble scale) gdouble scale)
{ {
g_return_val_if_fail (GIMP_IS_BRUSH (brush), NULL); g_return_val_if_fail (GIMP_IS_BRUSH (brush), NULL);
g_return_val_if_fail (brush->pixmap != NULL, NULL); g_return_val_if_fail (brush->pixmap != NULL, NULL);
...@@ -501,7 +501,7 @@ gimp_brush_scale_pixmap (GimpBrush *brush, ...@@ -501,7 +501,7 @@ gimp_brush_scale_pixmap (GimpBrush *brush,
if (scale == 1.0) if (scale == 1.0)
return temp_buf_copy (brush->pixmap, NULL); return temp_buf_copy (brush->pixmap, NULL);
return GIMP_BRUSH_GET_CLASS (brush)->scale_pixmap (brush, scale); return GIMP_BRUSH_GET_CLASS (brush)->transform_pixmap (brush, scale);
} }
TempBuf * TempBuf *
......
...@@ -56,13 +56,13 @@ struct _GimpBrushClass ...@@ -56,13 +56,13 @@ struct _GimpBrushClass
gboolean (* want_null_motion) (GimpBrush *brush, gboolean (* want_null_motion) (GimpBrush *brush,
GimpCoords *last_coords, GimpCoords *last_coords,
GimpCoords *cur_coords); GimpCoords *cur_coords);
void (* scale_size) (GimpBrush *brush, void (* transform_size) (GimpBrush *brush,
gdouble scale, gdouble scale,
gint *width, gint *width,
gint *height); gint *height);
TempBuf * (* scale_mask) (GimpBrush *brush, TempBuf * (* transform_mask) (GimpBrush *brush,
gdouble scale); gdouble scale);
TempBuf * (* scale_pixmap) (GimpBrush *brush, TempBuf * (* transform_pixmap) (GimpBrush *brush,
gdouble scale); gdouble scale);
/* signals */ /* signals */
...@@ -82,14 +82,14 @@ gboolean gimp_brush_want_null_motion (GimpBrush *brush, ...@@ -82,14 +82,14 @@ gboolean gimp_brush_want_null_motion (GimpBrush *brush,
GimpCoords *last_coords, GimpCoords *last_coords,
GimpCoords *cur_coords); GimpCoords *cur_coords);
/* Gets width and height of a scaled mask of the brush, for provided scale. */ /* Gets width and height of a transformed mask of the brush, for provided parameters. */
void gimp_brush_scale_size (GimpBrush *brush, void gimp_brush_transform_size (GimpBrush *brush,
gdouble scale, gdouble scale,
gint *width, gint *width,
gint *height); gint *height);
TempBuf * gimp_brush_scale_mask (GimpBrush *brush, TempBuf * gimp_brush_transform_mask (GimpBrush *brush,
gdouble scale); gdouble scale);
TempBuf * gimp_brush_scale_pixmap (GimpBrush *brush, TempBuf * gimp_brush_transform_pixmap (GimpBrush *brush,
gdouble scale); gdouble scale);
TempBuf * gimp_brush_get_mask (const GimpBrush *brush); TempBuf * gimp_brush_get_mask (const GimpBrush *brush);
......
...@@ -63,11 +63,11 @@ static void gimp_brush_generated_dirty (GimpData *data); ...@@ -63,11 +63,11 @@ static void gimp_brush_generated_dirty (GimpData *data);
static const gchar * gimp_brush_generated_get_extension (GimpData *data); static const gchar * gimp_brush_generated_get_extension (GimpData *data);
static GimpData * gimp_brush_generated_duplicate (GimpData *data); static GimpData * gimp_brush_generated_duplicate (GimpData *data);
static void gimp_brush_generated_scale_size (GimpBrush *gbrush, static void gimp_brush_generated_transform_size(GimpBrush *gbrush,
gdouble scale, gdouble scale,
gint *width, gint *width,
gint *height); gint *height);
static TempBuf * gimp_brush_generated_scale_mask (GimpBrush *gbrush, static TempBuf * gimp_brush_generated_transform_mask(GimpBrush *gbrush,
gdouble scale); gdouble scale);
static TempBuf * gimp_brush_generated_calc (GimpBrushGenerated *brush, static TempBuf * gimp_brush_generated_calc (GimpBrushGenerated *brush,
...@@ -106,16 +106,16 @@ gimp_brush_generated_class_init (GimpBrushGeneratedClass *klass) ...@@ -106,16 +106,16 @@ gimp_brush_generated_class_init (GimpBrushGeneratedClass *klass)
GimpDataClass *data_class = GIMP_DATA_CLASS (klass); GimpDataClass *data_class = GIMP_DATA_CLASS (klass);
GimpBrushClass *brush_class = GIMP_BRUSH_CLASS (klass); GimpBrushClass *brush_class = GIMP_BRUSH_CLASS (klass);
object_class->set_property = gimp_brush_generated_set_property; object_class->set_property = gimp_brush_generated_set_property;
object_class->get_property = gimp_brush_generated_get_property; object_class->get_property = gimp_brush_generated_get_property;
data_class->save = gimp_brush_generated_save; data_class->save = gimp_brush_generated_save;
data_class->dirty = gimp_brush_generated_dirty; data_class->dirty = gimp_brush_generated_dirty;
data_class->get_extension = gimp_brush_generated_get_extension; data_class->get_extension = gimp_brush_generated_get_extension;
data_class->duplicate = gimp_brush_generated_duplicate; data_class->duplicate = gimp_brush_generated_duplicate;
brush_class->scale_size = gimp_brush_generated_scale_size; brush_class->transform_size = gimp_brush_generated_transform_size;
brush_class->scale_mask = gimp_brush_generated_scale_mask; brush_class->transform_mask = gimp_brush_generated_transform_mask;
g_object_class_install_property (object_class, PROP_SHAPE, g_object_class_install_property (object_class, PROP_SHAPE,
g_param_spec_enum ("shape", NULL, NULL, g_param_spec_enum ("shape", NULL, NULL,
...@@ -277,10 +277,10 @@ gimp_brush_generated_duplicate (GimpData *data) ...@@ -277,10 +277,10 @@ gimp_brush_generated_duplicate (GimpData *data)
} }
static void static void
gimp_brush_generated_scale_size (GimpBrush *gbrush, gimp_brush_generated_transform_size (GimpBrush *gbrush,
gdouble scale, gdouble scale,
gint *width, gint *width,
gint *height) gint *height)
{ {
GimpBrushGenerated *brush = GIMP_BRUSH_GENERATED (gbrush); GimpBrushGenerated *brush = GIMP_BRUSH_GENERATED (gbrush);
gint half_width; gint half_width;
...@@ -301,8 +301,8 @@ gimp_brush_generated_scale_size (GimpBrush *gbrush, ...@@ -301,8 +301,8 @@ gimp_brush_generated_scale_size (GimpBrush *gbrush,
} }
static TempBuf * static TempBuf *
gimp_brush_generated_scale_mask (GimpBrush *gbrush, gimp_brush_generated_transform_mask (GimpBrush *gbrush,
gdouble scale) gdouble scale)
{ {
GimpBrushGenerated *brush = GIMP_BRUSH_GENERATED (gbrush); GimpBrushGenerated *brush = GIMP_BRUSH_GENERATED (gbrush);
...@@ -498,7 +498,7 @@ gimp_brush_generated_calc (GimpBrushGenerated *brush, ...@@ -498,7 +498,7 @@ gimp_brush_generated_calc (GimpBrushGenerated *brush,
return mask; return mask;
} }
/* This function is shared between gimp_brush_generated_scale_size and /* This function is shared between gimp_brush_generated_transform_size and
* gimp_brush_generated_calc, therefore we provide a bunch of optional * gimp_brush_generated_calc, therefore we provide a bunch of optional
* pointers for returnvalues. * pointers for returnvalues.
*/ */
......
...@@ -101,9 +101,9 @@ static TempBuf * gimp_brush_core_solidify_mask (GimpBrushCore *core, ...@@ -101,9 +101,9 @@ static TempBuf * gimp_brush_core_solidify_mask (GimpBrushCore *core,
gdouble y); gdouble y);
static gdouble gimp_brush_core_clamp_brush_scale (GimpBrushCore *core, static gdouble gimp_brush_core_clamp_brush_scale (GimpBrushCore *core,
gdouble scale); gdouble scale);
static TempBuf * gimp_brush_core_scale_mask (GimpBrushCore *core, static TempBuf * gimp_brush_core_transform_mask (GimpBrushCore *core,
GimpBrush *brush); GimpBrush *brush);
static TempBuf * gimp_brush_core_scale_pixmap (GimpBrushCore *core, static TempBuf * gimp_brush_core_transform_pixmap (GimpBrushCore *core,
GimpBrush *brush); GimpBrush *brush);
static void gimp_brush_core_invalidate_cache (GimpBrush *brush, static void gimp_brush_core_invalidate_cache (GimpBrush *brush,
...@@ -164,30 +164,44 @@ gimp_brush_core_init (GimpBrushCore *core) ...@@ -164,30 +164,44 @@ gimp_brush_core_init (GimpBrushCore *core)
{ {
gint i, j; gint i, j;
core->main_brush = NULL; core->main_brush = NULL;
core->brush = NULL; core->brush = NULL;
core->spacing = 1.0; core->spacing = 1.0;
core->scale = 1.0; core->scale = 1.0;
core->pressure_brush = NULL; core->pressure_brush = NULL;
for (i = 0; i < BRUSH_CORE_SOLID_SUBSAMPLE; i++) core->last_solid_brush = NULL;
for (j = 0; j < BRUSH_CORE_SOLID_SUBSAMPLE; j++) core->solid_cache_invalid = FALSE;
core->solid_brushes[i][j] = NULL;
core->transform_brush = NULL;
core->last_transform_brush = NULL;
core->last_transform_width = 0;
core->last_transform_height = 0;
core->last_scale = 1.0;
core->transform_pixmap = NULL;
core->last_transform_pixmap = NULL;
core->last_transform_pixmap_width = 0;
core->last_transform_pixmap_height = 0;
core->last_brush_mask = NULL;
core->cache_invalid = FALSE;
core->last_solid_brush = NULL; core->rand = g_rand_new ();
core->solid_cache_invalid = FALSE;
core->scale_brush = NULL; core->brush_bound_segs = NULL;
core->last_scale_brush = NULL; core->n_brush_bound_segs = 0;
core->last_scale_width = 0; core->brush_bound_width = 0;
core->last_scale_height = 0; core->brush_bound_height = 0;
core->last_scale = 1.0;
core->scale_pixmap = NULL; for (i = 0; i < BRUSH_CORE_SOLID_SUBSAMPLE; i++)
core->last_scale_pixmap = NULL; {
core->last_scale_pixmap_width = 0; for (j = 0; j < BRUSH_CORE_SOLID_SUBSAMPLE; j++)
core->last_scale_pixmap_height = 0; {
core->solid_brushes[i][j] = NULL;
}
}
for (i = 0; i < BRUSH_CORE_JITTER_LUTSIZE - 1; ++i) for (i = 0; i < BRUSH_CORE_JITTER_LUTSIZE - 1; ++i)
{ {
...@@ -200,18 +214,13 @@ gimp_brush_core_init (GimpBrushCore *core) ...@@ -200,18 +214,13 @@ gimp_brush_core_init (GimpBrushCore *core)
g_assert (BRUSH_CORE_SUBSAMPLE == KERNEL_SUBSAMPLE); g_assert (BRUSH_CORE_SUBSAMPLE == KERNEL_SUBSAMPLE);
for (i = 0; i < KERNEL_SUBSAMPLE + 1; i++) for (i = 0; i < KERNEL_SUBSAMPLE + 1; i++)
for (j = 0; j < KERNEL_SUBSAMPLE + 1; j++) {
core->kernel_brushes[i][j] = NULL; for (j = 0; j < KERNEL_SUBSAMPLE + 1; j++)
{
core->last_brush_mask = NULL; core->kernel_brushes[i][j] = NULL;
core->cache_invalid = FALSE; }
}
core->rand = g_rand_new ();
core->brush_bound_segs = NULL;
core->n_brush_bound_segs = 0;
core->brush_bound_width = 0;
core->brush_bound_height = 0;
} }
static void static void
...@@ -234,16 +243,16 @@ gimp_brush_core_finalize (GObject *object) ...@@ -234,16 +243,16 @@ gimp_brush_core_finalize (GObject *object)
core->solid_brushes[i][j] = NULL; core->solid_brushes[i][j] = NULL;
} }
if (core->scale_brush) if (core->transform_brush)
{ {
temp_buf_free (core->scale_brush); temp_buf_free (core->transform_brush);
core->scale_brush = NULL; core->transform_brush = NULL;
} }
if (core->scale_pixmap) if (core->transform_pixmap)
{ {
temp_buf_free (core->scale_pixmap); temp_buf_free (core->transform_pixmap);
core->scale_pixmap = NULL; core->transform_pixmap = NULL;
} }
if (core->rand) if (core->rand)
...@@ -694,7 +703,7 @@ gimp_brush_core_get_paint_area (GimpPaintCore *paint_core, ...@@ -694,7 +703,7 @@ gimp_brush_core_get_paint_area (GimpPaintCore *paint_core,
core->scale = gimp_brush_core_clamp_brush_scale (core, core->scale); core->scale = gimp_brush_core_clamp_brush_scale (core, core->scale);
gimp_brush_scale_size (core->brush, core->scale, &brush_width, &brush_height); gimp_brush_transform_size (core->brush, core->scale, &brush_width, &brush_height);
/* adjust the x and y coordinates to the upper left corner of the brush */ /* adjust the x and y coordinates to the upper left corner of the brush */
x = (gint) floor (paint_core->cur_coords.x) - (brush_width / 2); x = (gint) floor (paint_core->cur_coords.x) - (brush_width / 2);
...@@ -785,7 +794,7 @@ gimp_brush_core_create_bound_segs (GimpBrushCore *core, ...@@ -785,7 +794,7 @@ gimp_brush_core_create_bound_segs (GimpBrushCore *core,
{ {
scale = gimp_brush_core_clamp_brush_scale (core, scale); scale = gimp_brush_core_clamp_brush_scale (core, scale);
mask = gimp_brush_scale_mask (core->main_brush, scale); mask = gimp_brush_transform_mask (core->main_brush, scale);
} }
if (mask) if (mask)
...@@ -1278,8 +1287,8 @@ gimp_brush_core_clamp_brush_scale (GimpBrushCore *core, ...@@ -1278,8 +1287,8 @@ gimp_brush_core_clamp_brush_scale (GimpBrushCore *core,
} }
static TempBuf * static TempBuf *
gimp_brush_core_scale_mask (GimpBrushCore *core, gimp_brush_core_transform_mask (GimpBrushCore *core,
GimpBrush *brush) GimpBrush *brush)
{ {
gint width; gint width;
gint height; gint height;
...@@ -1290,36 +1299,36 @@ gimp_brush_core_scale_mask (GimpBrushCore *core, ...@@ -1290,36 +1299,36 @@ gimp_brush_core_scale_mask (GimpBrushCore *core,
if (core->scale == 1.0) if (core->scale == 1.0)
return brush->mask; return brush->mask;
gimp_brush_scale_size (brush, core->scale, &width, &height); gimp_brush_transform_size (brush, core->scale, &width, &height);
if (! core->cache_invalid && if (! core->cache_invalid &&
core->scale_brush && core->transform_brush &&
brush->mask == core->last_scale_brush && brush->mask == core->last_transform_brush &&
width == core->last_scale_width && width == core->last_transform_width &&
height == core->last_scale_height && height == core->last_transform_height &&
core->scale == core->last_scale) core->scale == core->last_scale)
{ {
return core->scale_brush; return core->transform_brush;
} }
core->last_scale_brush = brush->mask; core->last_transform_brush = brush->mask;
core->last_scale_width = width; core->last_transform_width = width;
core->last_scale_height = height; core->last_transform_height = height;
core->last_scale = core->scale; core->last_scale = core->scale;
if (core->scale_brush) if (core->transform_brush)
temp_buf_free (core->scale_brush); temp_buf_free (core->transform_brush);
core->scale_brush = gimp_brush_scale_mask (brush, core->scale); core->transform_brush = gimp_brush_transform_mask (brush, core->scale);
core->cache_invalid = TRUE; core->cache_invalid = TRUE;
core->solid_cache_invalid = TRUE; core->solid_cache_invalid = TRUE;
return core->scale_brush; return core->transform_brush;
} }
static TempBuf * static TempBuf *
gimp_brush_core_scale_pixmap (GimpBrushCore *core, gimp_brush_core_transform_pixmap (GimpBrushCore *core,
GimpBrush *brush) GimpBrush *brush)
{ {
gint width; gint width;
...@@ -1331,29 +1340,29 @@ gimp_brush_core_scale_pixmap (GimpBrushCore *core, ...@@ -1331,29 +1340,29 @@ gimp_brush_core_scale_pixmap (GimpBrushCore *core,
if (core->scale == 1.0) if (core->scale == 1.0)
return brush->pixmap; return brush->pixmap;
gimp_brush_scale_size (brush, core->scale, &width, &height); gimp_brush_transform_size (brush, core->scale, &width, &height);
if (! core->cache_invalid && if (! core->cache_invalid &&
core->scale_pixmap && core->transform_pixmap &&
brush->pixmap == core->last_scale_pixmap && brush->pixmap == core->last_transform_pixmap &&
width == core->last_scale_pixmap_width && width == core->last_transform_pixmap_width &&
height == core->last_scale_pixmap_height) height == core->last_transform_pixmap_height)
{ {
return core->scale_pixmap; return core->transform_pixmap;
} }
core->last_scale_pixmap = brush->pixmap; core->last_transform_pixmap = brush->pixmap;
core->last_scale_pixmap_width = width; core->last_transform_pixmap_width = width;
core->last_scale_pixmap_height = height; core->last_transform_pixmap_height = height;
if (core->scale_pixmap) if (core->transform_pixmap)
temp_buf_free (core->scale_pixmap); temp_buf_free (core->transform_pixmap);
core->scale_pixmap = gimp_brush_scale_pixmap (brush, core->scale); core->transform_pixmap = gimp_brush_transform_pixmap (brush, core->scale);
core->cache_invalid = TRUE; core->cache_invalid = TRUE;