[gegl] Remove dead code
- From: Daniel Sabo <daniels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gegl] Remove dead code
- Date: Mon, 10 Mar 2014 15:57:20 +0000 (UTC)
commit 68d16e8aee6749fb20d7abd59752d9dee0127c61
Author: Daniel Sabo <DanielSabo gmail com>
Date: Mon Mar 10 08:02:13 2014 -0700
Remove dead code
gegl/buffer/gegl-buffer-access.c | 162 --------------------------------------
1 files changed, 0 insertions(+), 162 deletions(-)
---
diff --git a/gegl/buffer/gegl-buffer-access.c b/gegl/buffer/gegl-buffer-access.c
index c300d9b..d982784 100644
--- a/gegl/buffer/gegl-buffer-access.c
+++ b/gegl/buffer/gegl-buffer-access.c
@@ -39,160 +39,6 @@
#include "gegl-buffer-iterator.h"
#include "gegl-buffer-cl-cache.h"
-#if 0
-static inline void
-gegl_buffer_pixel_set (GeglBuffer *buffer,
- gint x,
- gint y,
- const Babl *format,
- guchar *buf)
-{
- gint tile_width = buffer->tile_storage->tile_width;
- gint tile_height = buffer->tile_storage->tile_width;
- gint px_size = gegl_buffer_px_size (buffer);
- gint bpx_size = babl_format_get_bytes_per_pixel (format);
- const Babl *fish = NULL;
-
- gint abyss_x_total = buffer->abyss.x + buffer->abyss.width;
- gint abyss_y_total = buffer->abyss.y + buffer->abyss.height;
- gint buffer_x = buffer->extent.x;
- gint buffer_y = buffer->extent.y;
- gint buffer_abyss_x = buffer->abyss.x;
- gint buffer_abyss_y = buffer->abyss.y;
-
- if (format != buffer->soft_format)
- {
- fish = babl_fish (buffer->soft_format, format);
- }
-
- if (!(buffer_y + y >= buffer_abyss_y &&
- buffer_y + y < abyss_y_total &&
- buffer_x + x >= buffer_abyss_x &&
- buffer_x + x < abyss_x_total))
- { /* in abyss */
- return;
- }
- else
- {
- gint tiledy = buffer_y + buffer->shift_y + y;
- gint tiledx = buffer_x + buffer->shift_x + x;
-
- GeglTile *tile = gegl_tile_source_get_tile ((GeglTileSource *) (buffer),
- gegl_tile_indice (tiledx, tile_width),
- gegl_tile_indice (tiledy, tile_height),
- 0);
-
- if (tile)
- {
- gint offsetx = gegl_tile_offset (tiledx, tile_width);
- gint offsety = gegl_tile_offset (tiledy, tile_height);
- guchar *tp;
-
- gegl_tile_lock (tile);
- tp = gegl_tile_get_data (tile) +
- (offsety * tile_width + offsetx) * px_size;
- if (fish)
- babl_process (fish, buf, tp, 1);
- else
- memcpy (tp, buf, bpx_size);
-
- gegl_tile_unlock (tile);
- gegl_tile_unref (tile);
- }
- }
- return;
-}
-#endif
-
-static gboolean
-gegl_buffer_in_abyss (GeglBuffer *buffer,
- gint x,
- gint y )
-{
- gint buffer_shift_x = buffer->shift_x;
- gint buffer_shift_y = buffer->shift_y;
- gint buffer_abyss_x = buffer->abyss.x + buffer_shift_x;
- gint buffer_abyss_y = buffer->abyss.y + buffer_shift_y;
- gint abyss_x_total = buffer_abyss_x + buffer->abyss.width;
- gint abyss_y_total = buffer_abyss_y + buffer->abyss.height;
-
- gint tiledy = y + buffer_shift_y;
- gint tiledx = x + buffer_shift_x;
-
- return !(tiledy >= buffer_abyss_y &&
- tiledy < abyss_y_total &&
- tiledx >= buffer_abyss_x &&
- tiledx < abyss_x_total);
-}
-
-static inline void
-gegl_buffer_set_pixel (GeglBuffer *buffer,
- gint x,
- gint y,
- const Babl *format,
- gpointer data)
-{
- if (gegl_buffer_in_abyss( buffer, x, y))
- /* Nothing to set here */
- return;
-
- {
- guchar *buf = data;
- gint tile_width = buffer->tile_storage->tile_width;
- gint tile_height = buffer->tile_storage->tile_height;
- gint buffer_shift_x = buffer->shift_x;
- gint buffer_shift_y = buffer->shift_y;
- gint tiledy = y + buffer_shift_y;
- gint tiledx = x + buffer_shift_x;
- gint indice_x = gegl_tile_indice (tiledx, tile_width);
- gint indice_y = gegl_tile_indice (tiledy, tile_height);
- GeglTile *tile = NULL;
-
-
- if (buffer->tile_storage->hot_tile &&
- buffer->tile_storage->hot_tile->x == indice_x &&
- buffer->tile_storage->hot_tile->y == indice_y)
- {
- tile = buffer->tile_storage->hot_tile;
- }
- else
- {
- _gegl_buffer_drop_hot_tile (buffer);
- tile = gegl_tile_source_get_tile ((GeglTileSource *) (buffer),
- indice_x, indice_y,
- 0);
- }
-
- if (tile)
- {
- const Babl *fish = NULL;
- gint offsetx = gegl_tile_offset (tiledx, tile_width);
- gint offsety = gegl_tile_offset (tiledy, tile_height);
- gint bpx_size = babl_format_get_bytes_per_pixel (format);
- gint px_size = babl_format_get_bytes_per_pixel (buffer->soft_format);
- guchar *tp;
-
- if (format != buffer->soft_format)
- {
- fish = babl_fish ((gpointer) format,
- (gpointer) buffer->soft_format);
- }
-
- gegl_tile_lock (tile);
-
- tp = gegl_tile_get_data (tile) +
- (offsety * tile_width + offsetx) * px_size;
- if (fish)
- babl_process (fish, buf, tp, 1);
- else
- memcpy (tp, buf, bpx_size);
-
- gegl_tile_unlock (tile);
- buffer->tile_storage->hot_tile = tile;
- }
- }
-}
-
static void
gegl_buffer_get_pixel (GeglBuffer *buffer,
gint x,
@@ -1051,14 +897,6 @@ gegl_buffer_set_unlocked_no_notify (GeglBuffer *buffer,
gegl_buffer_cl_cache_flush (buffer, rect);
}
-#if 0 /* XXX: not thread safe */
- if (rect && rect->width == 1 && rect->height == 1) /* fast path */
- {
- gegl_buffer_set_pixel (buffer, rect->x, rect->y, format, src);
- }
- else
-#endif
-
gegl_buffer_iterate_write (buffer, rect, (void *) src, rowstride, format, 0);
if (gegl_buffer_is_shared (buffer))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]