[gimp/pippin/goat-invasion] app: gimptilebackendtilemanager fix missing last row/col of tiles
- From: Ãyvind KolÃs <ok src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/pippin/goat-invasion] app: gimptilebackendtilemanager fix missing last row/col of tiles
- Date: Wed, 14 Mar 2012 22:44:18 +0000 (UTC)
commit f5c7e7483b9dce45021e83089ec2c0ae88bc40bf
Author: Ãyvind KolÃs <pippin gimp org>
Date: Wed Mar 14 22:41:33 2012 +0000
app: gimptilebackendtilemanager fix missing last row/col of tiles
Avoid 0 copy assumptions for tiles with ewidth and eheight != 64
app/gegl/gimptilebackendtilemanager.c | 25 +++++++++++--------------
1 files changed, 11 insertions(+), 14 deletions(-)
---
diff --git a/app/gegl/gimptilebackendtilemanager.c b/app/gegl/gimptilebackendtilemanager.c
index ac4c85a..49343ec 100644
--- a/app/gegl/gimptilebackendtilemanager.c
+++ b/app/gegl/gimptilebackendtilemanager.c
@@ -212,24 +212,21 @@ gimp_tile_write (GimpTileBackendTileManager *backend_tm,
gimp_tile = tile_manager_get_at (backend_tm->priv->tile_manager,
x, y, TRUE, TRUE);
-
if (!gimp_tile)
return;
- /* if the memory pointer already points to the data, there is
- * no point in copying it
- */
- if (source != tile_data_pointer (gimp_tile, 0, 0))
+ tile_stride = TILE_WIDTH * tile_bpp (gimp_tile);
+ gimp_tile_stride = tile_ewidth (gimp_tile) * tile_bpp (gimp_tile);
+
+ if (source != tile_data_pointer (gimp_tile, 0, 0) ||
+ (tile_stride != gimp_tile_stride || TILE_HEIGHT != tile_eheight (gimp_tile)))
+ for (row = 0; row < tile_eheight (gimp_tile); row++)
+ memcpy (tile_data_pointer (gimp_tile, 0, row),
+ source + row * tile_stride,
+ gimp_tile_stride);
+ else
{
- tile_stride = TILE_WIDTH * tile_bpp (gimp_tile);
- gimp_tile_stride = tile_ewidth (gimp_tile) * tile_bpp (gimp_tile);
-
- for (row = 0; row < tile_eheight (gimp_tile); row++)
- {
- memcpy (tile_data_pointer (gimp_tile, 0, row),
- source + row * tile_stride,
- gimp_tile_stride);
- }
+ /* no copy needed */
}
tile_release (gimp_tile, TRUE);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]