Commit 47dcd4b9 authored by Ell's avatar Ell

libgimp: avoid libgimp tile-cache in the plug-in tile backend

In GimpTileBackendPlugin, avoid storing read/written tiles in the
libgimp tile-cache, since caching is already done by GEGL.
parent 60d407ac
......@@ -87,16 +87,25 @@ gimp_tile_ref (GimpTile *tile)
}
void
_gimp_tile_ref_noinit (GimpTile *tile)
_gimp_tile_ref_nocache (GimpTile *tile,
gboolean init)
{
g_return_if_fail (tile != NULL);
tile->ref_count++;
if (tile->ref_count == 1)
tile->data = g_new (guchar, tile->ewidth * tile->eheight * tile->bpp);
gimp_tile_cache_insert (tile);
{
if (init)
{
gimp_tile_get (tile);
tile->dirty = FALSE;
}
else
{
tile->data = g_new (guchar, tile->ewidth * tile->eheight * tile->bpp);
}
}
}
void
......
......@@ -58,7 +58,8 @@ void gimp_tile_cache_ntiles (gulong ntiles);
/* private function */
G_GNUC_INTERNAL void _gimp_tile_ref_noinit (GimpTile *tile);
G_GNUC_INTERNAL void _gimp_tile_ref_nocache (GimpTile *tile,
gboolean init);
G_GNUC_INTERNAL void _gimp_tile_cache_flush_drawable (GimpDrawable *drawable);
......
......@@ -93,8 +93,6 @@ _gimp_tile_backend_plugin_class_init (GimpTileBackendPluginClass *klass)
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->finalize = gimp_tile_backend_plugin_finalize;
gimp_tile_cache_ntiles (64);
}
static void
......@@ -209,7 +207,7 @@ gimp_tile_read_mul (GimpTileBackendPlugin *backend_plugin,
gimp_tile = gimp_drawable_get_tile (priv->drawable,
priv->shadow,
y + v, x + u);
gimp_tile_ref (gimp_tile);
_gimp_tile_ref_nocache (gimp_tile, TRUE);
{
gint ewidth = gimp_tile->ewidth;
......@@ -261,7 +259,7 @@ gimp_tile_write_mul (GimpTileBackendPlugin *backend_plugin,
gimp_tile = gimp_drawable_get_tile (priv->drawable,
priv->shadow,
y+v, x+u);
_gimp_tile_ref_noinit (gimp_tile);
_gimp_tile_ref_nocache (gimp_tile, FALSE);
{
gint ewidth = gimp_tile->ewidth;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment