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.

(cherry picked from commit 47dcd4b93a)
This commit is contained in:
Ell
2019-02-05 16:58:24 -05:00
parent 17f355e9f3
commit c9f4735669
3 changed files with 17 additions and 9 deletions

View File

@ -100,16 +100,25 @@ gimp_tile_ref_zero (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

View File

@ -62,7 +62,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);

View File

@ -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;