mirror of https://github.com/GNOME/gimp.git
sprinkled some const qualifiers and removed obscure shift code in favor of
2007-03-14 Sven Neumann <sven@gimp.org> * app/display/gimpdisplayshell-render.c: sprinkled some const qualifiers and removed obscure shift code in favor of letting the compiler do this optimization. svn path=/trunk/; revision=22121
This commit is contained in:
parent
b95ead41e3
commit
2e551e08fd
|
@ -1,3 +1,9 @@
|
||||||
|
2007-03-14 Sven Neumann <sven@gimp.org>
|
||||||
|
|
||||||
|
* app/display/gimpdisplayshell-render.c: sprinkled some const
|
||||||
|
qualifiers and removed obscure shift code in favor of letting the
|
||||||
|
compiler do this optimization.
|
||||||
|
|
||||||
2007-03-14 Sven Neumann <sven@gimp.org>
|
2007-03-14 Sven Neumann <sven@gimp.org>
|
||||||
|
|
||||||
* app/display/gimpdisplayshell.[ch]: renamed newly added members
|
* app/display/gimpdisplayshell.[ch]: renamed newly added members
|
||||||
|
|
|
@ -55,9 +55,9 @@ struct _RenderInfo
|
||||||
{
|
{
|
||||||
GimpDisplayShell *shell;
|
GimpDisplayShell *shell;
|
||||||
TileManager *src_tiles;
|
TileManager *src_tiles;
|
||||||
guint *alpha;
|
const guint *alpha;
|
||||||
guchar *scale;
|
const guchar *scale;
|
||||||
guchar *src;
|
const guchar *src;
|
||||||
guchar *dest;
|
guchar *dest;
|
||||||
gint x, y;
|
gint x, y;
|
||||||
gint w, h;
|
gint w, h;
|
||||||
|
@ -77,7 +77,7 @@ static void render_setup_notify (gpointer config,
|
||||||
|
|
||||||
|
|
||||||
static guchar *tile_buf = NULL;
|
static guchar *tile_buf = NULL;
|
||||||
static guint tile_shift = 0;
|
|
||||||
static guint check_mod = 0;
|
static guint check_mod = 0;
|
||||||
static guint check_shift = 0;
|
static guint check_shift = 0;
|
||||||
|
|
||||||
|
@ -86,6 +86,7 @@ void
|
||||||
gimp_display_shell_render_init (Gimp *gimp)
|
gimp_display_shell_render_init (Gimp *gimp)
|
||||||
{
|
{
|
||||||
g_return_if_fail (GIMP_IS_GIMP (gimp));
|
g_return_if_fail (GIMP_IS_GIMP (gimp));
|
||||||
|
g_return_if_fail (tile_buf == NULL);
|
||||||
|
|
||||||
g_signal_connect (gimp->config, "notify::transparency-size",
|
g_signal_connect (gimp->config, "notify::transparency-size",
|
||||||
G_CALLBACK (render_setup_notify),
|
G_CALLBACK (render_setup_notify),
|
||||||
|
@ -94,6 +95,9 @@ gimp_display_shell_render_init (Gimp *gimp)
|
||||||
G_CALLBACK (render_setup_notify),
|
G_CALLBACK (render_setup_notify),
|
||||||
gimp);
|
gimp);
|
||||||
|
|
||||||
|
/* allocate a buffer for arranging information from a row of tiles */
|
||||||
|
tile_buf = g_new (guchar, GIMP_RENDER_BUF_WIDTH * MAX_CHANNELS);
|
||||||
|
|
||||||
render_setup_notify (gimp->config, NULL, gimp);
|
render_setup_notify (gimp->config, NULL, gimp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -113,7 +117,6 @@ gimp_display_shell_render_exit (Gimp *gimp)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
render_setup_notify (gpointer config,
|
render_setup_notify (gpointer config,
|
||||||
GParamSpec *param_spec,
|
GParamSpec *param_spec,
|
||||||
|
@ -125,17 +128,6 @@ render_setup_notify (gpointer config,
|
||||||
"transparency-size", &check_size,
|
"transparency-size", &check_size,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
/* based on the tile size, determine the tile shift amount
|
|
||||||
* (assume here that tile_height and tile_width are equal)
|
|
||||||
*/
|
|
||||||
tile_shift = 0;
|
|
||||||
while ((1 << tile_shift) < TILE_WIDTH)
|
|
||||||
tile_shift++;
|
|
||||||
|
|
||||||
/* allocate a buffer for arranging information from a row of tiles */
|
|
||||||
if (! tile_buf)
|
|
||||||
tile_buf = g_new (guchar, GIMP_RENDER_BUF_WIDTH * MAX_CHANNELS);
|
|
||||||
|
|
||||||
switch (check_size)
|
switch (check_size)
|
||||||
{
|
{
|
||||||
case GIMP_CHECK_SIZE_SMALL_CHECKS:
|
case GIMP_CHECK_SIZE_SMALL_CHECKS:
|
||||||
|
@ -175,11 +167,12 @@ static void render_image_init_info (RenderInfo *info,
|
||||||
gint x,
|
gint x,
|
||||||
gint y,
|
gint y,
|
||||||
TileManager *tiles);
|
TileManager *tiles);
|
||||||
static guint * render_image_init_alpha (gint mult);
|
static const guint * render_image_init_alpha (gint mult);
|
||||||
static guchar * render_image_accelerate_scaling (gint width,
|
|
||||||
gint start,
|
static const guchar * render_image_accelerate_scaling (gint width,
|
||||||
gdouble scalex);
|
gint start,
|
||||||
static guchar * render_image_tile_fault (RenderInfo *info);
|
gdouble scalex);
|
||||||
|
static const guchar * render_image_tile_fault (RenderInfo *info);
|
||||||
|
|
||||||
|
|
||||||
static RenderFunc render_funcs[6] =
|
static RenderFunc render_funcs[6] =
|
||||||
|
@ -875,7 +868,7 @@ render_image_init_info (RenderInfo *info,
|
||||||
info->dest = shell->render_buf;
|
info->dest = shell->render_buf;
|
||||||
}
|
}
|
||||||
|
|
||||||
static guint *
|
static const guint *
|
||||||
render_image_init_alpha (gint mult)
|
render_image_init_alpha (gint mult)
|
||||||
{
|
{
|
||||||
static guint *alpha_mult = NULL;
|
static guint *alpha_mult = NULL;
|
||||||
|
@ -896,7 +889,7 @@ render_image_init_alpha (gint mult)
|
||||||
return alpha_mult;
|
return alpha_mult;
|
||||||
}
|
}
|
||||||
|
|
||||||
static guchar *
|
static const guchar *
|
||||||
render_image_accelerate_scaling (gint width,
|
render_image_accelerate_scaling (gint width,
|
||||||
gint start,
|
gint start,
|
||||||
gdouble scalex)
|
gdouble scalex)
|
||||||
|
@ -917,7 +910,7 @@ render_image_accelerate_scaling (gint width,
|
||||||
return scale;
|
return scale;
|
||||||
}
|
}
|
||||||
|
|
||||||
static guchar *
|
static const guchar *
|
||||||
render_image_tile_fault (RenderInfo *info)
|
render_image_tile_fault (RenderInfo *info)
|
||||||
{
|
{
|
||||||
Tile *tile;
|
Tile *tile;
|
||||||
|
@ -971,7 +964,7 @@ render_image_tile_fault (RenderInfo *info)
|
||||||
x += step;
|
x += step;
|
||||||
src += step * bpp;
|
src += step * bpp;
|
||||||
|
|
||||||
if ((x >> tile_shift) != tilex)
|
if ((x / TILE_WIDTH) != tilex)
|
||||||
{
|
{
|
||||||
tile_release (tile, FALSE);
|
tile_release (tile, FALSE);
|
||||||
tilex += 1;
|
tilex += 1;
|
||||||
|
|
Loading…
Reference in New Issue