Issue #440 - libgimp/gimptilebackendplugin.c provides no pyramid
In GimpTileBackendPlugin, return NULL when fetching z>0 tiles, instead of simply ignoring the z coordinate, so that the mipmapped tile is rendered locally. Likewise, avoid storing z>0 tiles. Note that this is suboptimal, since all the necessary level-0 tiles need to be sent to the buffer as a result. Ideally, we should extend the wire protocol to handle mipmapped tiles.
This commit is contained in:
@ -132,20 +132,31 @@ gimp_tile_backend_plugin_command (GeglTileSource *tile_store,
|
|||||||
switch (command)
|
switch (command)
|
||||||
{
|
{
|
||||||
case GEGL_TILE_GET:
|
case GEGL_TILE_GET:
|
||||||
|
/* TODO: fetch mipmapped tiles directly from gimp, instead of returning
|
||||||
|
* NULL to render them locally
|
||||||
|
*/
|
||||||
|
if (z == 0)
|
||||||
|
{
|
||||||
g_mutex_lock (&backend_plugin_mutex);
|
g_mutex_lock (&backend_plugin_mutex);
|
||||||
|
|
||||||
result = gimp_tile_read_mul (backend_plugin, x, y);
|
result = gimp_tile_read_mul (backend_plugin, x, y);
|
||||||
|
|
||||||
g_mutex_unlock (&backend_plugin_mutex);
|
g_mutex_unlock (&backend_plugin_mutex);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GEGL_TILE_SET:
|
case GEGL_TILE_SET:
|
||||||
|
/* TODO: actually store mipmapped tiles */
|
||||||
|
if (z == 0)
|
||||||
|
{
|
||||||
g_mutex_lock (&backend_plugin_mutex);
|
g_mutex_lock (&backend_plugin_mutex);
|
||||||
|
|
||||||
gimp_tile_write_mul (backend_plugin, x, y, gegl_tile_get_data (data));
|
gimp_tile_write_mul (backend_plugin, x, y, gegl_tile_get_data (data));
|
||||||
gegl_tile_mark_as_stored (data);
|
|
||||||
|
|
||||||
g_mutex_unlock (&backend_plugin_mutex);
|
g_mutex_unlock (&backend_plugin_mutex);
|
||||||
|
}
|
||||||
|
|
||||||
|
gegl_tile_mark_as_stored (data);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GEGL_TILE_FLUSH:
|
case GEGL_TILE_FLUSH:
|
||||||
|
Reference in New Issue
Block a user