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.
(cherry picked from commit d0ae39f017
)
This commit is contained in:
@ -132,20 +132,31 @@ gimp_tile_backend_plugin_command (GeglTileSource *tile_store,
|
||||
switch (command)
|
||||
{
|
||||
case GEGL_TILE_GET:
|
||||
g_mutex_lock (&backend_plugin_mutex);
|
||||
/* TODO: fetch mipmapped tiles directly from gimp, instead of returning
|
||||
* NULL to render them locally
|
||||
*/
|
||||
if (z == 0)
|
||||
{
|
||||
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;
|
||||
|
||||
case GEGL_TILE_SET:
|
||||
g_mutex_lock (&backend_plugin_mutex);
|
||||
/* TODO: actually store mipmapped tiles */
|
||||
if (z == 0)
|
||||
{
|
||||
g_mutex_lock (&backend_plugin_mutex);
|
||||
|
||||
gimp_tile_write_mul (backend_plugin, x, y, gegl_tile_get_data (data));
|
||||
|
||||
g_mutex_unlock (&backend_plugin_mutex);
|
||||
}
|
||||
|
||||
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);
|
||||
break;
|
||||
|
||||
case GEGL_TILE_FLUSH:
|
||||
|
Reference in New Issue
Block a user