[gimp/metadata-browser] app: completely remove TileManager and friends (base/ and paint-funcs/)



commit 9a63bb16e9f758453333503e4f16b668f3e95d20
Author: Michael Natterer <mitch gimp org>
Date:   Wed Jun 20 21:44:09 2012 +0200

    app: completely remove TileManager and friends (base/ and paint-funcs/)
    
    And along with it a lot of stuff like the drawable preview cache, the
    gegl tile manager backend, temporary gimp_gegl_buffer_foo() stuff, and
    the remaining bits of performance.
    
    The projection is in an evil semi-ported state which makes it work
    ok-ish for stuff like layer moving, but absolutely unbearable for
    painting, there is also an off-by-one rendering glitch at some zoom
    levels.

 app/Makefile.am                        |    4 -
 app/app.c                              |   23 -
 app/base/.gitignore                    |    7 -
 app/base/Makefile.am                   |   40 -
 app/base/base-types.h                  |   34 -
 app/base/base.c                        |  182 -----
 app/base/base.h                        |   27 -
 app/base/pixel-region.c                |  589 --------------
 app/base/pixel-region.h                |  121 ---
 app/base/tile-cache.c                  |  475 -----------
 app/base/tile-cache.h                  |   31 -
 app/base/tile-manager-preview.c        |  124 ---
 app/base/tile-manager-preview.h        |   36 -
 app/base/tile-manager-private.h        |   43 -
 app/base/tile-manager.c                |  858 --------------------
 app/base/tile-manager.h                |  149 ----
 app/base/tile-private.h                |  105 ---
 app/base/tile-pyramid.c                |  665 ---------------
 app/base/tile-pyramid.h                |   61 --
 app/base/tile-rowhints.c               |  263 ------
 app/base/tile-rowhints.h               |   48 --
 app/base/tile-swap.c                   |  794 ------------------
 app/base/tile-swap.h                   |   32 -
 app/base/tile.c                        |  342 --------
 app/base/tile.h                        |   79 --
 app/batch.c                            |    5 -
 app/core/Makefile.am                   |    4 -
 app/core/core-types.h                  |    1 -
 app/core/gimpchannel.c                 |   12 +-
 app/core/gimpdrawable-offset.c         |    4 +-
 app/core/gimpdrawable-preview.c        |  167 +----
 app/core/gimpdrawable-preview.h        |    2 +-
 app/core/gimpdrawable-private.h        |    3 -
 app/core/gimpdrawable-transform.c      |   22 +-
 app/core/gimpdrawable.c                |   59 +-
 app/core/gimpdrawablemodundo.c         |    2 +-
 app/core/gimpimage-convert-precision.c |    8 +-
 app/core/gimpimage-convert.c           |   10 +-
 app/core/gimpimage-preview.c           |   33 +-
 app/core/gimplayer.c                   |   17 +-
 app/core/gimpmaskundo.c                |    4 +-
 app/core/gimppreviewcache.c            |  297 -------
 app/core/gimppreviewcache.h            |   36 -
 app/core/gimpprojection-construct.c    |   60 --
 app/core/gimpprojection-construct.h    |   29 -
 app/core/gimpprojection.c              |  198 ++----
 app/core/gimpprojection.h              |   30 +-
 app/core/gimpselection.c               |    9 +-
 app/display/gimpdisplayshell-draw.c    |   10 +-
 app/display/gimpdisplayshell-render.c  | 1394 +-------------------------------
 app/gegl/Makefile.am                   |    4 +-
 app/gegl/gimp-gegl-utils.c             |   81 --
 app/gegl/gimp-gegl-utils.h             |   18 +-
 app/gegl/gimp-gegl.c                   |    4 +-
 app/gegl/gimptilebackendtilemanager.c  |  407 ----------
 app/gegl/gimptilebackendtilemanager.h  |   64 --
 app/main.c                             |    4 +-
 app/paint-funcs/.gitignore             |    7 -
 app/paint-funcs/Makefile.am            |   27 -
 app/paint-funcs/paint-funcs.c          |  382 ---------
 app/paint-funcs/paint-funcs.h          |   37 -
 app/paint-funcs/subsample-region.c     |  439 ----------
 app/paint-funcs/subsample-region.h     |   32 -
 app/tests.c                            |    8 -
 app/text/gimptextlayer.c               |    4 +-
 configure.ac                           |    2 -
 66 files changed, 210 insertions(+), 8858 deletions(-)
---
diff --git a/app/Makefile.am b/app/Makefile.am
index d2ee15f..eb51cbb 100644
--- a/app/Makefile.am
+++ b/app/Makefile.am
@@ -12,8 +12,6 @@ libgimpthumb = $(top_builddir)/libgimpthumb/libgimpthumb-$(GIMP_API_VERSION).la
 # so that when e.g. changing a header-file the subdirs are built in
 # the right order
 SUBDIRS = \
-	base		\
-	paint-funcs	\
 	config		\
 	core		\
 	operations	\
@@ -164,8 +162,6 @@ gimpconsoleldadd = \
 	operations/libappoperations.a	\
 	gegl/libappgegl.a		\
 	config/libappconfig.a		\
-	paint-funcs/libapppaint-funcs.a	\
-	base/libappbase.a		\
 	$(libgimpconfig)		\
 	$(libgimpmath)			\
 	$(libgimpthumb)			\
diff --git a/app/app.c b/app/app.c
index 57d2b83..38303d0 100644
--- a/app/app.c
+++ b/app/app.c
@@ -44,9 +44,6 @@
 
 #include "config/gimprc.h"
 
-#include "base/base.h"
-#include "base/tile-swap.h"
-
 #include "gegl/gimp-gegl.h"
 
 #include "core/gimp.h"
@@ -147,9 +144,7 @@ app_run (const gchar         *full_prog_name,
 {
   GimpInitStatusFunc  update_status_func = NULL;
   Gimp               *gimp;
-  GimpGeglConfig     *config;
   GMainLoop          *loop;
-  gboolean            swap_is_ok;
 
   /*  Create an instance of the "Gimp" object which is the root of the
    *  core object system
@@ -189,14 +184,10 @@ app_run (const gchar         *full_prog_name,
 
   gimp_load_config (gimp, alternate_system_gimprc, alternate_gimprc);
 
-  config = GIMP_GEGL_CONFIG (gimp->config);
-
   /*  change the locale if a language if specified  */
   language_init (gimp->config->language);
 
   /*  initialize lowlevel stuff  */
-  swap_is_ok = base_init (config, be_verbose, use_cpu_accel);
-
   gimp_gegl_init (gimp);
 
 #ifndef GIMP_CONSOLE_COMPILATION
@@ -216,19 +207,6 @@ app_run (const gchar         *full_prog_name,
    */
   gimp_restore (gimp, update_status_func);
 
-  /* display a warning when no test swap file could be generated */
-  if (! swap_is_ok)
-    {
-      gchar *path = gimp_config_path_expand (config->swap_path, FALSE, NULL);
-
-      g_message (_("Unable to open a test swap file.\n\n"
-		   "To avoid data loss, please check the location "
-		   "and permissions of the swap directory defined in "
-		   "your Preferences (currently \"%s\")."), path);
-
-      g_free (path);
-    }
-
   /*  enable autosave late so we don't autosave when the
    *  monitor resolution is set in gui_init()
    */
@@ -264,7 +242,6 @@ app_run (const gchar         *full_prog_name,
 
   errors_exit ();
   gegl_exit ();
-  base_exit ();
 }
 
 
diff --git a/app/batch.c b/app/batch.c
index 4fe3e32..f536468 100644
--- a/app/batch.c
+++ b/app/batch.c
@@ -26,8 +26,6 @@
 
 #include "core/core-types.h"
 
-#include "base/tile-swap.h"
-
 #include "core/gimp.h"
 #include "core/gimpparamspecs.h"
 
@@ -133,9 +131,6 @@ batch_exit_after_callback (Gimp *gimp)
 
   gegl_exit ();
 
-  /*  make sure that the swap files are removed before we quit */
-  tile_swap_exit ();
-
   exit (EXIT_SUCCESS);
 }
 
diff --git a/app/core/Makefile.am b/app/core/Makefile.am
index a2d2ae7..a58fd30 100644
--- a/app/core/Makefile.am
+++ b/app/core/Makefile.am
@@ -315,16 +315,12 @@ libappcore_a_sources = \
 	gimppdbprogress.h			\
 	gimppickable.c				\
 	gimppickable.h				\
-	gimppreviewcache.c			\
-	gimppreviewcache.h			\
 	gimpprogress.c				\
 	gimpprogress.h				\
 	gimpprojectable.c			\
 	gimpprojectable.h			\
 	gimpprojection.c			\
 	gimpprojection.h			\
-	gimpprojection-construct.c		\
-	gimpprojection-construct.h		\
 	gimpsamplepoint.c			\
 	gimpsamplepoint.h			\
 	gimpsamplepointundo.c			\
diff --git a/app/core/core-types.h b/app/core/core-types.h
index 5b79cd5..7f9df47 100644
--- a/app/core/core-types.h
+++ b/app/core/core-types.h
@@ -25,7 +25,6 @@
 #include "libgimpmodule/gimpmoduletypes.h"
 #include "libgimpthumb/gimpthumb-types.h"
 
-#include "base/base-types.h"
 #include "config/config-types.h"
 
 #include "core/core-enums.h"
diff --git a/app/core/gimpchannel.c b/app/core/gimpchannel.c
index 0518453..9ad873b 100644
--- a/app/core/gimpchannel.c
+++ b/app/core/gimpchannel.c
@@ -461,10 +461,10 @@ gimp_channel_convert (GimpItem  *item,
       format = gimp_drawable_get_format_without_alpha (drawable);
 
       new_buffer =
-        gimp_gegl_buffer_new (GEGL_RECTANGLE (0, 0,
-                                              gimp_item_get_width (item),
-                                              gimp_item_get_height (item)),
-                              format);
+        gegl_buffer_new (GEGL_RECTANGLE (0, 0,
+                                         gimp_item_get_width (item),
+                                         gimp_item_get_height (item)),
+                         format);
 
       gimp_rgba_set (&background, 0.0, 0.0, 0.0, 0.0);
       flatten = gimp_gegl_create_flatten_node (&background);
@@ -610,8 +610,8 @@ gimp_channel_scale (GimpItem              *item,
       GeglBuffer   *new_buffer;
 
       new_buffer =
-        gimp_gegl_buffer_new (GEGL_RECTANGLE (0, 0, new_width, new_height),
-                              gimp_drawable_get_format (drawable));
+        gegl_buffer_new (GEGL_RECTANGLE (0, 0, new_width, new_height),
+                         gimp_drawable_get_format (drawable));
 
       gimp_drawable_set_buffer_full (drawable,
                                      gimp_item_is_attached (item), NULL,
diff --git a/app/core/gimpdrawable-offset.c b/app/core/gimpdrawable-offset.c
index 2fe026c..71ae4f0 100644
--- a/app/core/gimpdrawable-offset.c
+++ b/app/core/gimpdrawable-offset.c
@@ -86,8 +86,8 @@ gimp_drawable_offset (GimpDrawable   *drawable,
 
   src_buffer = gimp_drawable_get_buffer (drawable);
 
-  new_buffer = gimp_gegl_buffer_new (GEGL_RECTANGLE (0, 0, width, height),
-                                     gimp_drawable_get_format (drawable));
+  new_buffer = gegl_buffer_new (GEGL_RECTANGLE (0, 0, width, height),
+                                gimp_drawable_get_format (drawable));
 
   if (! wrap_around)
     {
diff --git a/app/core/gimpdrawable-preview.c b/app/core/gimpdrawable-preview.c
index 93a2be7..305e260 100644
--- a/app/core/gimpdrawable-preview.c
+++ b/app/core/gimpdrawable-preview.c
@@ -25,76 +25,37 @@
 
 #include "core-types.h"
 
-#include "base/pixel-region.h"
-#include "base/tile-manager-preview.h"
-
-#include "paint-funcs/subsample-region.h"
-
 #include "config/gimpcoreconfig.h"
 
-#include "gegl/gimp-gegl-utils.h"
-
 #include "gimp.h"
 #include "gimpchannel.h"
 #include "gimpimage.h"
 #include "gimpdrawable-preview.h"
 #include "gimpdrawable-private.h"
 #include "gimplayer.h"
-#include "gimppreviewcache.h"
 #include "gimptempbuf.h"
 
 
-/*  local function prototypes  */
-
-static GimpTempBuf * gimp_drawable_preview_private (GimpDrawable *drawable,
-                                                    gint          width,
-                                                    gint          height);
-static GimpTempBuf * gimp_drawable_indexed_preview (GimpDrawable *drawable,
-                                                    const guchar *cmap,
-                                                    gint          src_x,
-                                                    gint          src_y,
-                                                    gint          src_width,
-                                                    gint          src_height,
-                                                    gint          dest_width,
-                                                    gint          dest_height);
-
-
 /*  public functions  */
 
 GimpTempBuf *
-gimp_drawable_get_preview (GimpViewable *viewable,
-                           GimpContext  *context,
-                           gint          width,
-                           gint          height)
+gimp_drawable_get_new_preview (GimpViewable *viewable,
+                               GimpContext  *context,
+                               gint          width,
+                               gint          height)
 {
-  GimpDrawable *drawable = GIMP_DRAWABLE (viewable);
-  GimpImage    *image    = gimp_item_get_image (GIMP_ITEM (drawable));
+  GimpItem  *item  = GIMP_ITEM (viewable);
+  GimpImage *image = gimp_item_get_image (item);
 
-  if (! image->gimp->config->layer_previews ||
-      /* XXX fixme enable drawable previews for > u8 */
-      gimp_drawable_get_precision (drawable) != GIMP_PRECISION_U8)
+  if (! image->gimp->config->layer_previews)
     return NULL;
 
-  /* Ok prime the cache with a large preview if the cache is invalid */
-  if (! drawable->private->preview_valid                        &&
-      width  <= PREVIEW_CACHE_PRIME_WIDTH                       &&
-      height <= PREVIEW_CACHE_PRIME_HEIGHT                      &&
-      image                                                     &&
-      gimp_image_get_width  (image) > PREVIEW_CACHE_PRIME_WIDTH &&
-      gimp_image_get_height (image) > PREVIEW_CACHE_PRIME_HEIGHT)
-    {
-      GimpTempBuf *tb = gimp_drawable_preview_private (drawable,
-                                                       PREVIEW_CACHE_PRIME_WIDTH,
-                                                       PREVIEW_CACHE_PRIME_HEIGHT);
-
-      /* Save the 2nd call */
-      if (width  == PREVIEW_CACHE_PRIME_WIDTH &&
-          height == PREVIEW_CACHE_PRIME_HEIGHT)
-        return tb;
-    }
-
-  /* Second call - should NOT visit the tile cache...*/
-  return gimp_drawable_preview_private (drawable, width, height);
+  return gimp_drawable_get_sub_preview (GIMP_DRAWABLE (viewable),
+                                        0, 0,
+                                        gimp_item_get_width  (item),
+                                        gimp_item_get_height (item),
+                                        width,
+                                        height);
 }
 
 const Babl *
@@ -130,9 +91,11 @@ gimp_drawable_get_sub_preview (GimpDrawable *drawable,
                                gint          dest_width,
                                gint          dest_height)
 {
-  GimpItem   *item;
-  GimpImage  *image;
-  GeglBuffer *buffer;
+  GimpItem    *item;
+  GimpImage   *image;
+  GeglBuffer  *buffer;
+  GimpTempBuf *preview;
+  gdouble      scale;
 
   g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), NULL);
   g_return_val_if_fail (src_x >= 0, NULL);
@@ -149,93 +112,23 @@ gimp_drawable_get_sub_preview (GimpDrawable *drawable,
 
   image = gimp_item_get_image (item);
 
-  if (! image->gimp->config->layer_previews ||
-      /* XXX fixme enable drawable previews for > u8 */
-      gimp_drawable_get_precision (drawable) != GIMP_PRECISION_U8)
+  if (! image->gimp->config->layer_previews)
     return NULL;
 
-  if (gimp_drawable_is_indexed (drawable))
-    return gimp_drawable_indexed_preview (drawable,
-                                          gimp_drawable_get_colormap (drawable),
-                                          src_x, src_y, src_width, src_height,
-                                          dest_width, dest_height);
-
   buffer = gimp_drawable_get_buffer (drawable);
 
-  return tile_manager_get_sub_preview (gimp_gegl_buffer_get_tiles (buffer),
-                                       gimp_drawable_get_preview_format (drawable),
-                                       src_x, src_y, src_width, src_height,
-                                       dest_width, dest_height);
-}
-
-
-/*  private functions  */
-
-static GimpTempBuf *
-gimp_drawable_preview_private (GimpDrawable *drawable,
-                               gint          width,
-                               gint          height)
-{
-  GimpTempBuf *ret_buf = NULL;
-
-  if (! drawable->private->preview_valid ||
-      ! (ret_buf = gimp_preview_cache_get (&drawable->private->preview_cache,
-                                           width, height)))
-    {
-      GimpItem *item = GIMP_ITEM (drawable);
-
-      ret_buf = gimp_drawable_get_sub_preview (drawable,
-                                               0, 0,
-                                               gimp_item_get_width (item),
-                                               gimp_item_get_height (item),
-                                               width,
-                                               height);
-
-      if (! drawable->private->preview_valid)
-        gimp_preview_cache_invalidate (&drawable->private->preview_cache);
-
-      drawable->private->preview_valid = TRUE;
-
-      gimp_preview_cache_add (&drawable->private->preview_cache, ret_buf);
-    }
-
-  return ret_buf;
-}
-
-static GimpTempBuf *
-gimp_drawable_indexed_preview (GimpDrawable *drawable,
-                               const guchar *cmap,
-                               gint          src_x,
-                               gint          src_y,
-                               gint          src_width,
-                               gint          src_height,
-                               gint          dest_width,
-                               gint          dest_height)
-{
-  GeglBuffer  *buffer;
-  GimpTempBuf *preview_buf;
-  PixelRegion  srcPR;
-  PixelRegion  destPR;
-  gint         subsample = 1;
-
-  /*  calculate 'acceptable' subsample  */
-  while ((dest_width  * (subsample + 1) * 2 < src_width) &&
-         (dest_height * (subsample + 1) * 2 < src_width))
-    subsample += 1;
-
-  buffer = gimp_drawable_get_buffer (drawable);
-
-  pixel_region_init (&srcPR, gimp_gegl_buffer_get_tiles (buffer),
-                     src_x, src_y, src_width, src_height,
-                     FALSE);
-
-  preview_buf = gimp_temp_buf_new (dest_width, dest_height,
-                                   gimp_drawable_get_preview_format (drawable));
+  preview = gimp_temp_buf_new (dest_width, dest_height,
+                               gimp_drawable_get_preview_format (drawable));
 
-  pixel_region_init_temp_buf (&destPR, preview_buf,
-                              0, 0, dest_width, dest_height);
+  scale = MIN ((gdouble) dest_width  / (gdouble) gegl_buffer_get_width  (buffer),
+               (gdouble) dest_height / (gdouble) gegl_buffer_get_height (buffer));
 
-  subsample_indexed_region (&srcPR, &destPR, cmap, subsample);
+  gegl_buffer_get (buffer,
+                   GEGL_RECTANGLE (src_x, src_y, dest_width, dest_height),
+                   scale,
+                   gimp_temp_buf_get_format (preview),
+                   gimp_temp_buf_get_data (preview),
+                   GEGL_AUTO_ROWSTRIDE, GEGL_ABYSS_NONE);
 
-  return preview_buf;
+  return preview;
 }
diff --git a/app/core/gimpdrawable-preview.h b/app/core/gimpdrawable-preview.h
index 4b4cba9..0a552ce 100644
--- a/app/core/gimpdrawable-preview.h
+++ b/app/core/gimpdrawable-preview.h
@@ -22,7 +22,7 @@
 /*
  *  virtual function of GimpDrawable -- dont't call directly
  */
-GimpTempBuf * gimp_drawable_get_preview        (GimpViewable *viewable,
+GimpTempBuf * gimp_drawable_get_new_preview    (GimpViewable *viewable,
                                                 GimpContext  *context,
                                                 gint          width,
                                                 gint          height);
diff --git a/app/core/gimpdrawable-private.h b/app/core/gimpdrawable-private.h
index b829faf..bfe9d38 100644
--- a/app/core/gimpdrawable-private.h
+++ b/app/core/gimpdrawable-private.h
@@ -32,9 +32,6 @@ struct _GimpDrawablePrivate
   GeglNode      *fs_mode_node;
 
   GeglNode      *mode_node;
-
-  GSList        *preview_cache; /* preview caches of the channel */
-  gboolean       preview_valid; /* is the preview valid?         */
 };
 
 #endif /* __GIMP_DRAWABLE_PRIVATE_H__ */
diff --git a/app/core/gimpdrawable-transform.c b/app/core/gimpdrawable-transform.c
index d9b4e7e..f47c0b6 100644
--- a/app/core/gimpdrawable-transform.c
+++ b/app/core/gimpdrawable-transform.c
@@ -128,8 +128,8 @@ gimp_drawable_transform_buffer_affine (GimpDrawable           *drawable,
                                   &x1, &y1, &x2, &y2);
 
   /*  Get the new temporary buffer for the transformed result  */
-  new_buffer = gimp_gegl_buffer_new (GEGL_RECTANGLE (0, 0, x2 - x1, y2 - y1),
-                                     gegl_buffer_get_format (orig_buffer));
+  new_buffer = gegl_buffer_new (GEGL_RECTANGLE (0, 0, x2 - x1, y2 - y1),
+                                gegl_buffer_get_format (orig_buffer));
 
   gimp_matrix3_identity (&gegl_matrix);
   gimp_matrix3_translate (&gegl_matrix, u1, v1);
@@ -209,9 +209,9 @@ gimp_drawable_transform_buffer_flip (GimpDrawable        *drawable,
       break;
     }
 
-  new_buffer = gimp_gegl_buffer_new (GEGL_RECTANGLE (0, 0,
-                                                     new_width, new_height),
-                                     gegl_buffer_get_format (orig_buffer));
+  new_buffer = gegl_buffer_new (GEGL_RECTANGLE (0, 0,
+                                                new_width, new_height),
+                                gegl_buffer_get_format (orig_buffer));
 
   if (clip_result && (new_x != orig_x || new_y != orig_y))
     {
@@ -420,9 +420,9 @@ gimp_drawable_transform_buffer_rotate (GimpDrawable     *drawable,
       gint       clip_x, clip_y;
       gint       clip_width, clip_height;
 
-      new_buffer = gimp_gegl_buffer_new (GEGL_RECTANGLE (0, 0,
-                                                         orig_width, orig_height),
-                                         gegl_buffer_get_format (orig_buffer));
+      new_buffer = gegl_buffer_new (GEGL_RECTANGLE (0, 0,
+                                                    orig_width, orig_height),
+                                    gegl_buffer_get_format (orig_buffer));
 
       *new_offset_x = orig_x;
       *new_offset_y = orig_y;
@@ -497,9 +497,9 @@ gimp_drawable_transform_buffer_rotate (GimpDrawable     *drawable,
     }
   else
     {
-      new_buffer = gimp_gegl_buffer_new (GEGL_RECTANGLE (0, 0,
-                                                         new_width, new_height),
-                                         gegl_buffer_get_format (orig_buffer));
+      new_buffer = gegl_buffer_new (GEGL_RECTANGLE (0, 0,
+                                                    new_width, new_height),
+                                    gegl_buffer_get_format (orig_buffer));
 
       *new_offset_x = new_x;
       *new_offset_y = new_y;
diff --git a/app/core/gimpdrawable.c b/app/core/gimpdrawable.c
index 3c9b287..58cd405 100644
--- a/app/core/gimpdrawable.c
+++ b/app/core/gimpdrawable.c
@@ -47,7 +47,6 @@
 #include "gimpmarshal.h"
 #include "gimppattern.h"
 #include "gimppickable.h"
-#include "gimppreviewcache.h"
 #include "gimpprogress.h"
 
 #include "gimp-log.h"
@@ -76,7 +75,6 @@ static gint64     gimp_drawable_get_memsize        (GimpObject        *object,
 static gboolean   gimp_drawable_get_size           (GimpViewable      *viewable,
                                                     gint              *width,
                                                     gint              *height);
-static void       gimp_drawable_invalidate_preview (GimpViewable      *viewable);
 
 static void       gimp_drawable_removed            (GimpItem          *item);
 static void       gimp_drawable_visibility_changed (GimpItem          *item);
@@ -215,8 +213,7 @@ gimp_drawable_class_init (GimpDrawableClass *klass)
   gimp_object_class->get_memsize     = gimp_drawable_get_memsize;
 
   viewable_class->get_size           = gimp_drawable_get_size;
-  viewable_class->invalidate_preview = gimp_drawable_invalidate_preview;
-  viewable_class->get_preview        = gimp_drawable_get_preview;
+  viewable_class->get_new_preview    = gimp_drawable_get_new_preview;
 
   item_class->removed                = gimp_drawable_removed;
   item_class->visibility_changed     = gimp_drawable_visibility_changed;
@@ -295,9 +292,6 @@ gimp_drawable_finalize (GObject *object)
       drawable->private->source_node = NULL;
     }
 
-  if (drawable->private->preview_cache)
-    gimp_preview_cache_invalidate (&drawable->private->preview_cache);
-
   G_OBJECT_CLASS (parent_class)->finalize (object);
 }
 
@@ -311,8 +305,6 @@ gimp_drawable_get_memsize (GimpObject *object,
   memsize += gimp_gegl_buffer_get_memsize (gimp_drawable_get_buffer (drawable));
   memsize += gimp_gegl_buffer_get_memsize (drawable->private->shadow);
 
-  *gui_size += gimp_preview_cache_get_memsize (drawable->private->preview_cache);
-
   return memsize + GIMP_OBJECT_CLASS (parent_class)->get_memsize (object,
                                                                   gui_size);
 }
@@ -331,19 +323,6 @@ gimp_drawable_get_size (GimpViewable *viewable,
 }
 
 static void
-gimp_drawable_invalidate_preview (GimpViewable *viewable)
-{
-  GimpDrawable *drawable = GIMP_DRAWABLE (viewable);
-
-  GIMP_VIEWABLE_CLASS (parent_class)->invalidate_preview (viewable);
-
-  drawable->private->preview_valid = FALSE;
-
-  if (drawable->private->preview_cache)
-    gimp_preview_cache_invalidate (&drawable->private->preview_cache);
-}
-
-static void
 gimp_drawable_removed (GimpItem *item)
 {
   GimpDrawable *drawable = GIMP_DRAWABLE (item);
@@ -411,7 +390,7 @@ gimp_drawable_duplicate (GimpItem *item,
         g_object_unref (new_drawable->private->buffer);
 
       new_drawable->private->buffer =
-        gimp_gegl_buffer_dup (gimp_drawable_get_buffer (drawable));
+        gegl_buffer_dup (gimp_drawable_get_buffer (drawable));
     }
 
   return new_item;
@@ -430,9 +409,9 @@ gimp_drawable_scale (GimpItem              *item,
   GeglBuffer   *new_buffer;
   GeglNode     *scale;
 
-  new_buffer = gimp_gegl_buffer_new (GEGL_RECTANGLE (0, 0,
-                                                     new_width, new_height),
-                                     gimp_drawable_get_format (drawable));
+  new_buffer = gegl_buffer_new (GEGL_RECTANGLE (0, 0,
+                                                new_width, new_height),
+                                gimp_drawable_get_format (drawable));
 
   scale = g_object_new (GEGL_TYPE_NODE,
                         "operation", "gegl:scale",
@@ -498,9 +477,9 @@ gimp_drawable_resize (GimpItem    *item,
                             &copy_width,
                             &copy_height);
 
-  new_buffer = gimp_gegl_buffer_new (GEGL_RECTANGLE (0, 0,
-                                                     new_width, new_height),
-                                     gimp_drawable_get_format (drawable));
+  new_buffer = gegl_buffer_new (GEGL_RECTANGLE (0, 0,
+                                                new_width, new_height),
+                                gimp_drawable_get_format (drawable));
 
   if (copy_width  != new_width ||
       copy_height != new_height)
@@ -707,10 +686,10 @@ gimp_drawable_real_convert_type (GimpDrawable      *drawable,
                                   gimp_drawable_has_alpha (drawable));
 
   dest_buffer =
-    gimp_gegl_buffer_new (GEGL_RECTANGLE (0, 0,
-                                          gimp_item_get_width  (GIMP_ITEM (drawable)),
-                                          gimp_item_get_height (GIMP_ITEM (drawable))),
-                          format);
+    gegl_buffer_new (GEGL_RECTANGLE (0, 0,
+                                     gimp_item_get_width  (GIMP_ITEM (drawable)),
+                                     gimp_item_get_height (GIMP_ITEM (drawable))),
+                     format);
 
   gegl_buffer_copy (gimp_drawable_get_buffer (drawable), NULL,
                     dest_buffer, NULL);
@@ -722,8 +701,10 @@ gimp_drawable_real_convert_type (GimpDrawable      *drawable,
 static GeglBuffer *
 gimp_drawable_real_get_buffer (GimpDrawable *drawable)
 {
+#if 0
   gegl_buffer_flush (drawable->private->buffer);
   gimp_gegl_buffer_refetch_tiles (drawable->private->buffer);
+#endif
 
   return drawable->private->buffer;
 }
@@ -1069,9 +1050,9 @@ gimp_drawable_new (GType          type,
                                            offset_x, offset_y,
                                            width, height));
 
-  drawable->private->buffer = gimp_gegl_buffer_new (GEGL_RECTANGLE (0, 0,
-                                                                    width, height),
-                                                    format);
+  drawable->private->buffer = gegl_buffer_new (GEGL_RECTANGLE (0, 0,
+                                                               width, height),
+                                               format);
 
   return drawable;
 }
@@ -1096,12 +1077,6 @@ gimp_drawable_update (GimpDrawable *drawable,
 {
   g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
 
-  if (drawable->private->buffer)
-    {
-      gegl_buffer_flush (drawable->private->buffer);
-      gimp_gegl_buffer_refetch_tiles (drawable->private->buffer);
-    }
-
   g_signal_emit (drawable, gimp_drawable_signals[UPDATE], 0,
                  x, y, width, height);
 }
diff --git a/app/core/gimpdrawablemodundo.c b/app/core/gimpdrawablemodundo.c
index bbb9e71..bedce9c 100644
--- a/app/core/gimpdrawablemodundo.c
+++ b/app/core/gimpdrawablemodundo.c
@@ -108,7 +108,7 @@ gimp_drawable_mod_undo_constructed (GObject *object)
   if (drawable_mod_undo->copy_buffer)
     {
       drawable_mod_undo->buffer =
-        gimp_gegl_buffer_dup (gimp_drawable_get_buffer (drawable));
+        gegl_buffer_dup (gimp_drawable_get_buffer (drawable));
     }
   else
     {
diff --git a/app/core/gimpimage-convert-precision.c b/app/core/gimpimage-convert-precision.c
index 27ab6dc..26162a8 100644
--- a/app/core/gimpimage-convert-precision.c
+++ b/app/core/gimpimage-convert-precision.c
@@ -116,10 +116,10 @@ gimp_image_convert_precision (GimpImage     *image,
 
     gimp_image_undo_push_mask_precision (image, NULL, mask);
 
-    buffer = gimp_gegl_buffer_new (GEGL_RECTANGLE (0, 0,
-                                                   gimp_image_get_width  (image),
-                                                   gimp_image_get_height (image)),
-                                   gimp_image_get_mask_format (image));
+    buffer = gegl_buffer_new (GEGL_RECTANGLE (0, 0,
+                                              gimp_image_get_width  (image),
+                                              gimp_image_get_height (image)),
+                              gimp_image_get_mask_format (image));
 
     gegl_buffer_copy (gimp_drawable_get_buffer (GIMP_DRAWABLE (mask)), NULL,
                       buffer, NULL);
diff --git a/app/core/gimpimage-convert.c b/app/core/gimpimage-convert.c
index 1574cb0..629d550 100644
--- a/app/core/gimpimage-convert.c
+++ b/app/core/gimpimage-convert.c
@@ -988,11 +988,11 @@ gimp_image_convert (GimpImage               *image,
             has_alpha = gimp_drawable_has_alpha (GIMP_DRAWABLE (layer));
 
             new_buffer =
-              gimp_gegl_buffer_new (GEGL_RECTANGLE (0, 0,
-                                                    gimp_item_get_width  (GIMP_ITEM (layer)),
-                                                    gimp_item_get_height (GIMP_ITEM (layer))),
-                                    gimp_image_get_layer_format (image,
-                                                                 has_alpha));
+              gegl_buffer_new (GEGL_RECTANGLE (0, 0,
+                                               gimp_item_get_width  (GIMP_ITEM (layer)),
+                                               gimp_item_get_height (GIMP_ITEM (layer))),
+                               gimp_image_get_layer_format (image,
+                                                            has_alpha));
 
             quantobj->nth_layer = nth_layer;
             quantobj->second_pass (quantobj, layer, new_buffer);
diff --git a/app/core/gimpimage-preview.c b/app/core/gimpimage-preview.c
index d4bf816..3df9287 100644
--- a/app/core/gimpimage-preview.c
+++ b/app/core/gimpimage-preview.c
@@ -21,13 +21,12 @@
 
 #include "core-types.h"
 
-#include "base/tile-manager-preview.h"
-
 #include "gegl/gimp-babl.h"
 
 #include "gimpimage.h"
 #include "gimpimage-preview.h"
 #include "gimpimage-private.h"
+#include "gimppickable.h"
 #include "gimpprojectable.h"
 #include "gimpprojection.h"
 #include "gimptempbuf.h"
@@ -133,41 +132,25 @@ gimp_image_get_new_preview (GimpViewable *viewable,
   GimpProjection *projection = gimp_image_get_projection (image);
   const Babl     *format;
   GimpTempBuf    *buf;
-  TileManager    *tiles;
   gdouble         scale_x;
   gdouble         scale_y;
-  gint            level;
-  gboolean        is_premult;
 
   scale_x = (gdouble) width  / (gdouble) gimp_image_get_width  (image);
   scale_y = (gdouble) height / (gdouble) gimp_image_get_height (image);
 
-  level = gimp_projection_get_level (projection, scale_x, scale_y);
-  tiles = gimp_projection_get_tiles_at_level (projection, level, &is_premult);
-
   format = gimp_projectable_get_format (GIMP_PROJECTABLE (image));
-
   format = gimp_babl_format (gimp_babl_format_get_base_type (format),
                              GIMP_PRECISION_U8,
                              babl_format_has_alpha (format));
 
-  buf = tile_manager_get_preview (tiles, format, width, height);
+  buf = gimp_temp_buf_new (width, height, format);
 
-  if (is_premult)
-    {
-      if (format == babl_format ("Y'A u8"))
-        {
-          gimp_temp_buf_set_format (buf, babl_format ("Y'aA u8"));
-        }
-      else if (format == babl_format ("R'G'B'A u8"))
-        {
-          gimp_temp_buf_set_format (buf, babl_format ("R'aG'aB'aA u8"));
-        }
-      else
-        {
-          g_warn_if_reached ();
-        }
-    }
+  gegl_buffer_get (gimp_pickable_get_buffer (GIMP_PICKABLE (projection)),
+                   GEGL_RECTANGLE (0, 0, width, height),
+                   MIN (scale_x, scale_y),
+                   gimp_temp_buf_get_format (buf),
+                   gimp_temp_buf_get_data (buf),
+                   GEGL_AUTO_ROWSTRIDE, GEGL_ABYSS_NONE);
 
   return buf;
 }
diff --git a/app/core/gimplayer.c b/app/core/gimplayer.c
index 61b74f3..a7117a9 100644
--- a/app/core/gimplayer.c
+++ b/app/core/gimplayer.c
@@ -1790,11 +1790,10 @@ gimp_layer_add_alpha (GimpLayer *layer)
   item     = GIMP_ITEM (layer);
   drawable = GIMP_DRAWABLE (layer);
 
-  new_buffer =
-    gimp_gegl_buffer_new (GEGL_RECTANGLE (0, 0,
-                                          gimp_item_get_width  (item),
-                                          gimp_item_get_height (item)),
-                          gimp_drawable_get_format_with_alpha (drawable));
+  new_buffer = gegl_buffer_new (GEGL_RECTANGLE (0, 0,
+                                                gimp_item_get_width  (item),
+                                                gimp_item_get_height (item)),
+                                gimp_drawable_get_format_with_alpha (drawable));
 
   gegl_buffer_copy (gimp_drawable_get_buffer (drawable), NULL,
                     new_buffer, NULL);
@@ -1821,10 +1820,10 @@ gimp_layer_flatten (GimpLayer   *layer,
     return;
 
   new_buffer =
-    gimp_gegl_buffer_new (GEGL_RECTANGLE (0, 0,
-                                          gimp_item_get_width  (GIMP_ITEM (layer)),
-                                          gimp_item_get_height (GIMP_ITEM (layer))),
-                          gimp_drawable_get_format_without_alpha (GIMP_DRAWABLE (layer)));
+    gegl_buffer_new (GEGL_RECTANGLE (0, 0,
+                                     gimp_item_get_width  (GIMP_ITEM (layer)),
+                                     gimp_item_get_height (GIMP_ITEM (layer))),
+                     gimp_drawable_get_format_without_alpha (GIMP_DRAWABLE (layer)));
 
   gimp_context_get_background (context, &background);
   flatten = gimp_gegl_create_flatten_node (&background);
diff --git a/app/core/gimpmaskundo.c b/app/core/gimpmaskundo.c
index e0607c7..43be537 100644
--- a/app/core/gimpmaskundo.c
+++ b/app/core/gimpmaskundo.c
@@ -218,8 +218,8 @@ gimp_mask_undo_pop (GimpUndo            *undo,
       gint        width  = gimp_item_get_width  (GIMP_ITEM (channel));
       gint        height = gimp_item_get_height (GIMP_ITEM (channel));
 
-      buffer = gimp_gegl_buffer_new (GEGL_RECTANGLE (0, 0, width, height),
-                                     mask_undo->format);
+      buffer = gegl_buffer_new (GEGL_RECTANGLE (0, 0, width, height),
+                                mask_undo->format);
       gegl_buffer_clear (buffer, NULL);
 
       gimp_drawable_set_buffer (drawable, FALSE, NULL, buffer);
diff --git a/app/core/gimpprojection.c b/app/core/gimpprojection.c
index c2146f5..e70f1e7 100644
--- a/app/core/gimpprojection.c
+++ b/app/core/gimpprojection.c
@@ -21,22 +21,16 @@
 
 #include "core-types.h"
 
-#include "base/tile.h"
-#include "base/tile-rowhints.h" /* EEK */
-#include "base/tile-private.h"  /* EEK */
-#include "base/tile-manager.h"
-#include "base/tile-pyramid.h"
-
 #include "gegl/gimp-gegl-utils.h"
 
 #include "gimp.h"
+#include "gimp-utils.h"
 #include "gimparea.h"
 #include "gimpimage.h"
 #include "gimpmarshal.h"
 #include "gimppickable.h"
 #include "gimpprojectable.h"
 #include "gimpprojection.h"
-#include "gimpprojection-construct.h"
 
 
 /*  halfway between G_PRIORITY_HIGH_IDLE and G_PRIORITY_DEFAULT_IDLE  */
@@ -93,9 +87,6 @@ static void        gimp_projection_invalidate            (GimpProjection  *proj,
                                                           guint            y,
                                                           guint            w,
                                                           guint            h);
-static void        gimp_projection_validate_tile         (TileManager     *tm,
-                                                          Tile            *tile,
-                                                          GimpProjection  *proj);
 
 static void        gimp_projection_projectable_invalidate(GimpProjectable *projectable,
                                                           gint             x,
@@ -148,7 +139,6 @@ static void
 gimp_projection_init (GimpProjection *proj)
 {
   proj->projectable              = NULL;
-  proj->pyramid                  = NULL;
   proj->buffer                   = NULL;
   proj->update_areas             = NULL;
   proj->idle_render.idle_id      = 0;
@@ -184,12 +174,6 @@ gimp_projection_finalize (GObject *object)
   gimp_area_list_free (proj->idle_render.update_areas);
   proj->idle_render.update_areas = NULL;
 
-  if (proj->pyramid)
-    {
-      tile_pyramid_destroy (proj->pyramid);
-      proj->pyramid = NULL;
-    }
-
   if (proj->buffer)
     {
       g_object_unref (proj->buffer);
@@ -219,8 +203,7 @@ gimp_projection_get_memsize (GimpObject *object,
   GimpProjection *projection = GIMP_PROJECTION (object);
   gint64          memsize    = 0;
 
-  if (projection->pyramid)
-    memsize = tile_pyramid_get_memsize (projection->pyramid);
+  memsize += gimp_gegl_buffer_get_memsize (projection->buffer);
 
   return memsize + GIMP_OBJECT_CLASS (parent_class)->get_memsize (object,
                                                                   gui_size);
@@ -303,10 +286,15 @@ gimp_projection_get_buffer (GimpPickable *pickable)
 
   if (! proj->buffer)
     {
-      TileManager *tiles  = gimp_projection_get_tiles_at_level (proj, 0, NULL);
-      const Babl  *format = gimp_projection_get_format (pickable);
+      const Babl *format;
+      gint        width;
+      gint        height;
+
+      format = gimp_projection_get_format (GIMP_PICKABLE (proj));
+      gimp_projectable_get_size (proj->projectable, &width, &height);
 
-      proj->buffer = gimp_tile_manager_create_buffer (tiles, format);
+      proj->buffer = gegl_buffer_new (GEGL_RECTANGLE (0, 0, width, height),
+                                      format);
 
       if (proj->sink_node)
         {
@@ -372,6 +360,7 @@ gimp_projection_new (GimpProjectable *projectable)
   return proj;
 }
 
+#ifdef USE_BUFFER
 GeglNode *
 gimp_projection_get_sink_node (GimpProjection *proj)
 {
@@ -385,9 +374,11 @@ gimp_projection_get_sink_node (GimpProjection *proj)
 
   proj->graph = gegl_node_new ();
 
+#if 0
   g_object_set (proj->graph,
                 "dont-cache", TRUE,
                 NULL);
+#endif
 
   graph = gimp_projectable_get_graph (proj->projectable);
   gegl_node_add_child (proj->graph, graph);
@@ -405,57 +396,7 @@ gimp_projection_get_sink_node (GimpProjection *proj)
 
   return proj->sink_node;
 }
-
-TileManager *
-gimp_projection_get_tiles_at_level (GimpProjection *proj,
-                                    gint            level,
-                                    gboolean       *is_premult)
-{
-  g_return_val_if_fail (GIMP_IS_PROJECTION (proj), NULL);
-
-  if (! proj->pyramid)
-    {
-      const Babl *format;
-      gint        bytes;
-      gint        width;
-      gint        height;
-
-      format = gimp_projection_get_format (GIMP_PICKABLE (proj));
-
-      bytes = babl_format_get_bytes_per_pixel (format);
-      gimp_projectable_get_size (proj->projectable, &width, &height);
-
-      proj->pyramid = tile_pyramid_new (bytes, width, height);
-
-      tile_pyramid_set_validate_proc (proj->pyramid,
-                                      (TileValidateProc) gimp_projection_validate_tile,
-                                      proj);
-    }
-
-  return tile_pyramid_get_tiles (proj->pyramid, level, is_premult);
-}
-
-/**
- * gimp_projection_get_level:
- * @proj:    pointer to a GimpProjection
- * @scale_x: horizontal scale factor
- * @scale_y: vertical scale factor
- *
- * This function returns the optimal pyramid level for a given scale factor.
- *
- * Return value: the pyramid level to use for a given display scale factor.
- **/
-gint
-gimp_projection_get_level (GimpProjection *proj,
-                           gdouble         scale_x,
-                           gdouble         scale_y)
-{
-  gint width, height;
-
-  gimp_projectable_get_size (proj->projectable, &width, &height);
-
-  return tile_pyramid_get_level (width, height, MAX (scale_x, scale_y));
-}
+#endif
 
 void
 gimp_projection_flush (GimpProjection *proj)
@@ -754,90 +695,51 @@ gimp_projection_paint_area (GimpProjection *proj,
                  y2 - y1);
 }
 
+#ifdef USE_BUFFER
 static void
-gimp_projection_invalidate (GimpProjection *proj,
-                            guint           x,
-                            guint           y,
-                            guint           w,
-                            guint           h)
-{
-  if (proj->pyramid)
-    {
-      if (proj->sink_node)
-        {
-          GeglBuffer *buffer;
-
-          buffer = gimp_projection_get_buffer (GIMP_PICKABLE (proj));
-
-          /* makes the buffer drop all GimpTiles */
-          gimp_gegl_buffer_refetch_tiles (buffer);
-        }
-
-      tile_pyramid_invalidate_area (proj->pyramid, x, y, w, h);
-    }
-}
-
-static void
-gimp_projection_validate_tile (TileManager    *tm,
-                               Tile           *tile,
-                               GimpProjection *proj)
+gimp_projection_construct (GimpProjection *proj,
+                           gint            x,
+                           gint            y,
+                           gint            w,
+                           gint            h)
 {
-  Tile *additional[7];
-  gint  n_additional = 0;
-  gint  x, y;
-  gint  width, height;
-  gint  tile_width, tile_height;
-  gint  col, row;
-  gint  i;
+  GeglRectangle rect = { x, y, w, h };
 
-  /*  Find the coordinates of this tile  */
-  tile_manager_get_tile_coordinates (tm, tile, &x, &y);
-
-  width  = tile_width  = tile_ewidth (tile);
-  height = tile_height = tile_eheight (tile);
+  g_return_if_fail (GIMP_IS_PROJECTION (proj));
 
-  tile_manager_get_tile_col_row (tm, tile, &col, &row);
+  /* GEGL should really do this for us... */
+  gegl_buffer_clear (proj->buffer, &rect);
 
-  /*  try to validate up to 8 invalid tiles in a row  */
-  while (tile_width == TILE_WIDTH && n_additional < 7)
+  if (! proj->processor)
     {
-      Tile *t;
-
-      col++;
-
-      /*  get the next tile without any read or write access, so it
-       *  won't be locked (and validated)
-       */
-      t = tile_manager_get_at (tm, col, row, FALSE, FALSE);
-
-      /*  if we hit the right border, or a valid tile, bail out
-       */
-      if (! t || tile_is_valid (t))
-        break;
-
-      /*  HACK: mark the tile as valid, so locking it with r/w access
-       *  won't validate it
-       */
-      t->valid = TRUE;
-      t = tile_manager_get_at (tm, col, row, TRUE, TRUE);
-
-      /*  add the tile's width to the chunk to validate  */
-      tile_width = tile_ewidth (t);
-      width += tile_width;
+      GeglNode *sink = gimp_projection_get_sink_node (proj);
 
-      additional[n_additional++] = t;
+      proj->processor = gegl_node_new_processor (sink, &rect);
     }
-
-  gimp_projection_construct (proj, x, y, width, height);
-
-  for (i = 0; i < n_additional; i++)
+  else
     {
-      /*  HACK: mark the tile as valid, because we know it is  */
-      additional[i]->valid = TRUE;
-      tile_release (additional[i], TRUE);
+      gegl_processor_set_rectangle (proj->processor, &rect);
     }
+
+  while (gegl_processor_work (proj->processor, NULL));
+}
+#endif
+
+static void
+gimp_projection_invalidate (GimpProjection *proj,
+                            guint           x,
+                            guint           y,
+                            guint           w,
+                            guint           h)
+{
+  /*  FIXME: this should happen as we actually *read* from the buffer
+   */
+#ifdef USE_BUFFER
+  gimp_projection_construct (proj, x, y, w, h);
+#endif
 }
 
+
 /*  image callbacks  */
 
 static void
@@ -878,12 +780,6 @@ gimp_projection_projectable_changed (GimpProjectable *projectable,
   gimp_area_list_free (proj->update_areas);
   proj->update_areas = NULL;
 
-  if (proj->pyramid)
-    {
-      tile_pyramid_destroy (proj->pyramid);
-      proj->pyramid = NULL;
-    }
-
   if (proj->buffer)
     {
       g_object_unref (proj->buffer);
diff --git a/app/core/gimpprojection.h b/app/core/gimpprojection.h
index 3948ce5..657fd40 100644
--- a/app/core/gimpprojection.h
+++ b/app/core/gimpprojection.h
@@ -19,6 +19,9 @@
 #define __GIMP_PROJECTION_H__
 
 
+#define USE_BUFFER 1
+
+
 #include "gimpobject.h"
 
 
@@ -54,7 +57,6 @@ struct _GimpProjection
 
   GimpProjectable          *projectable;
 
-  TilePyramid              *pyramid;
   GeglBuffer               *buffer;
 
   GeglNode                 *graph;
@@ -82,25 +84,19 @@ struct _GimpProjectionClass
 
 GType            gimp_projection_get_type         (void) G_GNUC_CONST;
 
-GimpProjection * gimp_projection_new              (GimpProjectable      *projectable);
-
-GeglNode       * gimp_projection_get_sink_node    (GimpProjection       *proj);
+GimpProjection * gimp_projection_new              (GimpProjectable   *projectable);
 
-TileManager    * gimp_projection_get_tiles_at_level
-                                                  (GimpProjection       *proj,
-                                                   gint                  level,
-                                                   gboolean             *is_premult);
-gint             gimp_projection_get_level        (GimpProjection       *proj,
-                                                   gdouble               scale_x,
-                                                   gdouble               scale_y);
+#if USE_BUFFER
+GeglNode       * gimp_projection_get_sink_node    (GimpProjection    *proj);
+#endif
 
-void             gimp_projection_flush            (GimpProjection       *proj);
-void             gimp_projection_flush_now        (GimpProjection       *proj);
-void             gimp_projection_finish_draw      (GimpProjection       *proj);
+void             gimp_projection_flush            (GimpProjection    *proj);
+void             gimp_projection_flush_now        (GimpProjection    *proj);
+void             gimp_projection_finish_draw      (GimpProjection    *proj);
 
-gint64           gimp_projection_estimate_memsize (GimpImageBaseType     type,
-                                                   gint                  width,
-                                                   gint                  height);
+gint64           gimp_projection_estimate_memsize (GimpImageBaseType  type,
+                                                   gint               width,
+                                                   gint               height);
 
 
 #endif /*  __GIMP_PROJECTION_H__  */
diff --git a/app/core/gimpselection.c b/app/core/gimpselection.c
index b511965..ec981d7 100644
--- a/app/core/gimpselection.c
+++ b/app/core/gimpselection.c
@@ -320,8 +320,13 @@ gimp_selection_invalidate_boundary (GimpDrawable *drawable)
                           gimp_item_get_width  (GIMP_ITEM (layer)),
                           gimp_item_get_height (GIMP_ITEM (layer)));
 
+#ifdef __GNUC__
+#warning FIXME is this still needed?
+#endif
+#if 0
   /*  invalidate the preview  */
   drawable->private->preview_valid = FALSE;
+#endif
 }
 
 static gboolean
@@ -700,8 +705,8 @@ gimp_selection_extract (GimpSelection *selection,
   src_buffer = gimp_pickable_get_buffer (pickable);
 
   /*  Allocate the temp buffer  */
-  dest_buffer = gimp_gegl_buffer_new (GEGL_RECTANGLE (0, 0, x2 - x1, y2 - y1),
-                                      dest_format);
+  dest_buffer = gegl_buffer_new (GEGL_RECTANGLE (0, 0, x2 - x1, y2 - y1),
+                                 dest_format);
 
   /*  First, copy the pixels, possibly doing INDEXED->RGB and adding alpha  */
   gegl_buffer_copy (src_buffer, GEGL_RECTANGLE (x1, y1, x2 - x1, y2 - y1),
diff --git a/app/display/gimpdisplayshell-draw.c b/app/display/gimpdisplayshell-draw.c
index 5466631..b0a56de 100644
--- a/app/display/gimpdisplayshell-draw.c
+++ b/app/display/gimpdisplayshell-draw.c
@@ -161,20 +161,12 @@ gimp_display_shell_draw_image (GimpDisplayShell *shell,
     {
       for (j = x; j < x2; j += GIMP_DISPLAY_RENDER_BUF_WIDTH)
         {
-          gint disp_xoffset, disp_yoffset;
           gint dx, dy;
 
           dx = MIN (x2 - j, GIMP_DISPLAY_RENDER_BUF_WIDTH);
           dy = MIN (y2 - i, GIMP_DISPLAY_RENDER_BUF_HEIGHT);
 
-          gimp_display_shell_scroll_get_disp_offset (shell,
-                                                     &disp_xoffset,
-                                                     &disp_yoffset);
-
-          gimp_display_shell_render (shell, cr,
-                                     j - disp_xoffset,
-                                     i - disp_yoffset,
-                                     dx, dy);
+          gimp_display_shell_render (shell, cr, j, i, dx, dy);
         }
     }
 }
diff --git a/app/display/gimpdisplayshell-render.c b/app/display/gimpdisplayshell-render.c
index 55f3b41..f68327f 100644
--- a/app/display/gimpdisplayshell-render.c
+++ b/app/display/gimpdisplayshell-render.c
@@ -25,9 +25,6 @@
 
 #include "display-types.h"
 
-#include "base/tile-manager.h"
-#include "base/tile.h"
-
 #include "config/gimpdisplayconfig.h"
 
 #include "gegl/gimp-gegl-utils.h"
@@ -35,95 +32,17 @@
 #include "core/gimpdrawable.h"
 #include "core/gimpimage.h"
 #include "core/gimppickable.h"
+#include "core/gimpprojectable.h"
 #include "core/gimpprojection.h"
 
 #include "gimpdisplay.h"
 #include "gimpdisplayshell.h"
+#include "gimpdisplayshell-transform.h"
 #include "gimpdisplayshell-filter.h"
 #include "gimpdisplayshell-render.h"
 #include "gimpdisplayshell-scroll.h"
 
 
-#define GIMP_DISPLAY_ZOOM_FAST     (1 << 0) /* use the fastest possible code
-                                               path trading quality for speed
-                                             */
-#define GIMP_DISPLAY_ZOOM_PIXEL_AA (1 << 1) /* provide AA edges when zooming in
-                                               on the actual pixels (in current
-                                               code only enables it between
-                                               100% and 200% zoom)
-                                             */
-
-
-typedef struct _RenderInfo  RenderInfo;
-
-typedef void (* RenderFunc) (RenderInfo *info);
-
-struct _RenderInfo
-{
-  TileManager  *src_tiles;
-  const guchar *src;
-  gboolean      src_is_premult;
-  guchar       *dest;
-  gint          x, y;
-  gint          w, h;
-  gdouble       scalex;       /* scale from (pre-scaled) src to dest       */
-  gdouble       scaley;
-  gdouble       full_scalex;  /* actual display scale factor               */
-  gdouble       full_scaley;
-  gint          src_x;
-  gint          src_y;
-  gint          dest_bpl;
-
-  gint          zoom_quality;
-
-  /* Bresenham helpers */
-  gint          x_dest_inc;   /* amount to increment for each dest. pixel  */
-  gint          x_src_dec;    /* amount to decrement for each source pixel */
-  gint64        dx_start;     /* pixel fraction for first pixel            */
-
-  gint          y_dest_inc;
-  gint          y_src_dec;
-  gint64        dy_start;
-
-  gint          footprint_x;
-  gint          footprint_y;
-  gint          footshift_x;
-  gint          footshift_y;
-
-  gint64        dy;
-};
-
-
-static guchar tile_buf[GIMP_DISPLAY_RENDER_BUF_WIDTH * MAX_CHANNELS];
-
-
-static void  gimp_display_shell_render_info_init (RenderInfo       *info,
-                                                  GimpDisplayShell *shell,
-                                                  gint              x,
-                                                  gint              y,
-                                                  gint              w,
-                                                  gint              h,
-                                                  cairo_surface_t  *dest,
-                                                  TileManager      *tiles,
-                                                  gint              level,
-                                                  gboolean          is_premult);
-
-/*  Render Image functions  */
-
-static void           render_image_alpha         (RenderInfo       *info);
-static void           render_image_gray_a        (RenderInfo       *info);
-static void           render_image_rgb_a         (RenderInfo       *info);
-
-static const guchar * render_image_tile_fault    (RenderInfo       *info);
-
-
-/*****************************************************************/
-/*  This function is the core of the display -- it offsets and   */
-/*  scales the image according to the current parameters in the  */
-/*  display object.  It handles RGBA and GRAYA projection tiles  */
-/*  and renders them to an ARGB32 cairo surface.                 */
-/*****************************************************************/
-
 void
 gimp_display_shell_render (GimpDisplayShell *shell,
                            cairo_t          *cr,
@@ -132,49 +51,42 @@ gimp_display_shell_render (GimpDisplayShell *shell,
                            gint              w,
                            gint              h)
 {
+#ifdef USE_BUFFER
   GimpProjection *projection;
+  GeglBuffer     *buffer;
+#endif
   GimpImage      *image;
-  TileManager    *tiles;
-  RenderInfo      info;
-  const Babl     *format;
-  gint            level;
-  gboolean        premult;
 
   g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
   g_return_if_fail (cr != NULL);
   g_return_if_fail (w > 0 && h > 0);
 
   image = gimp_display_get_image (shell->display);
-  projection = gimp_image_get_projection (image);
-
-  /* setup RenderInfo for rendering a GimpProjection level. */
-  level = gimp_projection_get_level (projection,
-                                     shell->scale_x, shell->scale_y);
-
-  tiles = gimp_projection_get_tiles_at_level (projection, level, &premult);
 
-  gimp_display_shell_render_info_init (&info,
-                                       shell, x, y, w, h,
-                                       shell->render_surface,
-                                       tiles, level, premult);
-
-  /* Currently, only RGBA and GRAYA projection types are used. */
-  format = gimp_pickable_get_format (GIMP_PICKABLE (projection));
-
-  if (format == babl_format ("R'G'B'A u8"))
-    {
-      render_image_rgb_a (&info);
-    }
-  else if (format == babl_format ("Y'A u8"))
-    {
-      render_image_gray_a (&info);
-    }
-  else
-    {
-      g_warning ("%s: unsupported projection type (%s)", G_STRFUNC,
-                 babl_get_name (format));
-      g_assert_not_reached ();
-    }
+#ifdef USE_BUFFER
+  projection = gimp_image_get_projection (image);
+  buffer = gimp_pickable_get_buffer (GIMP_PICKABLE (projection));
+
+  gegl_buffer_get (buffer,
+                   GEGL_RECTANGLE (x + shell->offset_x,
+                                   y + shell->offset_y,
+                                   w, h),
+                   shell->scale_x,
+                   babl_format ("cairo-ARGB32"),
+                   cairo_image_surface_get_data (shell->render_surface),
+                   cairo_image_surface_get_stride (shell->render_surface),
+                   GEGL_ABYSS_NONE);
+#else
+  gegl_node_blit (gimp_projectable_get_graph (GIMP_PROJECTABLE (image)),
+                  shell->scale_x,
+                  GEGL_RECTANGLE (src_x * shell->scale_x,
+                                  src_y * shell->scale_y,
+                                  w, h),
+                  babl_format ("cairo-ARGB32"),
+                  cairo_image_surface_get_data (shell->render_surface),
+                  cairo_image_surface_get_stride (shell->render_surface),
+                  0);
+#endif
 
   /*  apply filters to the rendered projection  */
   if (shell->filter_stack)
@@ -195,6 +107,7 @@ gimp_display_shell_render (GimpDisplayShell *shell,
 
   cairo_surface_mark_dirty_rectangle (shell->render_surface, 0, 0, w, h);
 
+#if 0
   if (shell->mask)
     {
       GeglBuffer *buffer;
@@ -220,1264 +133,27 @@ gimp_display_shell_render (GimpDisplayShell *shell,
 
       cairo_surface_mark_dirty (shell->mask_surface);
     }
+#endif
 
   /*  put it to the screen  */
   {
-    gint disp_xoffset, disp_yoffset;
-
     cairo_save (cr);
 
-    gimp_display_shell_scroll_get_disp_offset (shell,
-                                               &disp_xoffset, &disp_yoffset);
-
-    cairo_rectangle (cr, x + disp_xoffset, y + disp_yoffset, w, h);
+    cairo_rectangle (cr, x, y, w, h);
     cairo_clip (cr);
 
-    cairo_set_source_surface (cr, shell->render_surface,
-                              x + disp_xoffset, y + disp_yoffset);
+    cairo_set_source_surface (cr, shell->render_surface, x, y);
     cairo_paint (cr);
 
+#if 0
     if (shell->mask)
       {
         gimp_cairo_set_source_rgba (cr, &shell->mask_color);
         cairo_mask_surface (cr, shell->mask_surface,
                             x + disp_xoffset, y + disp_yoffset);
       }
+#endif
 
     cairo_restore (cr);
   }
 }
-
-/*  render a GRAY tile to an A8 cairo surface  */
-static void
-render_image_alpha (RenderInfo *info)
-{
-  gint y, ye;
-  gint x, xe;
-
-  y  = info->y;
-  ye = info->y + info->h;
-  xe = info->x + info->w;
-
-  info->dy = info->dy_start;
-  info->src = render_image_tile_fault (info);
-
-  while (TRUE)
-    {
-      const guchar *src  = info->src;
-      guchar       *dest = info->dest;
-
-      for (x = info->x; x < xe; x++, src++, dest++)
-        {
-          *dest = *src;
-        }
-
-      if (++y == ye)
-        break;
-
-      info->dest  += info->dest_bpl;
-
-      info->dy    += info->y_dest_inc;
-      info->src_y += info->dy / info->y_src_dec;
-      info->dy     = info->dy % info->y_src_dec;
-
-      info->src = render_image_tile_fault (info);
-    }
-}
-
-/*  render a GRAYA tile to an ARGB32 cairo surface  */
-static void
-render_image_gray_a (RenderInfo *info)
-{
-  gint y, ye;
-  gint x, xe;
-
-  y  = info->y;
-  ye = info->y + info->h;
-  xe = info->x + info->w;
-
-  info->dy = info->dy_start;
-  info->src = render_image_tile_fault (info);
-
-  while (TRUE)
-    {
-      const guchar *src  = info->src;
-      guint32      *dest = (guint32 *) info->dest;
-
-      for (x = info->x; x < xe; x++, src += 2, dest++)
-        {
-          /*  data in src is premultiplied already  */
-          *dest = (src[1] << 24) | (src[0] << 16) | (src[0] << 8) | src[0];
-        }
-
-      if (++y == ye)
-        break;
-
-      info->dest  += info->dest_bpl;
-
-      info->dy    += info->y_dest_inc;
-      info->src_y += info->dy / info->y_src_dec;
-      info->dy     = info->dy % info->y_src_dec;
-
-      info->src = render_image_tile_fault (info);
-    }
-}
-
-/*  render an RGBA tile to an ARGB32 cairo surface  */
-static void
-render_image_rgb_a (RenderInfo *info)
-{
-  gint y, ye;
-  gint x, xe;
-
-  y  = info->y;
-  ye = info->y + info->h;
-  xe = info->x + info->w;
-
-  info->dy = info->dy_start;
-  info->src = render_image_tile_fault (info);
-
-  while (TRUE)
-    {
-      const guchar *src  = info->src;
-      guint32      *dest = (guint32 *) info->dest;
-
-      for (x = info->x; x < xe; x++, src += 4, dest++)
-        {
-          /*  data in src is premultiplied already  */
-          *dest = (src[3] << 24) | (src[0] << 16) | (src[1] << 8) | src[2];
-        }
-
-      if (++y == ye)
-        break;
-
-      info->dest  += info->dest_bpl;
-
-      info->dy    += info->y_dest_inc;
-      info->src_y += info->dy / info->y_src_dec;
-      info->dy     = info->dy % info->y_src_dec;
-
-      if (info->src_y >= 0)
-        info->src = render_image_tile_fault (info);
-    }
-}
-
-static void
-gimp_display_shell_render_info_init (RenderInfo       *info,
-                                     GimpDisplayShell *shell,
-                                     gint              x,
-                                     gint              y,
-                                     gint              w,
-                                     gint              h,
-                                     cairo_surface_t  *dest,
-                                     TileManager      *tiles,
-                                     gint              level,
-                                     gboolean          is_premult)
-{
-  gint offset_x;
-  gint offset_y;
-
-  gimp_display_shell_scroll_get_render_start_offset (shell,
-						     &offset_x, &offset_y);
-
-  info->x = x + offset_x;
-  info->y = y + offset_y;
-  info->w = w;
-  info->h = h;
-
-  /* This function must be called before switching from drawing
-   * on the surface with cairo to drawing on it directly
-   */
-  cairo_surface_flush (dest);
-
-  info->dest        = cairo_image_surface_get_data (dest);
-  info->dest_bpl    = cairo_image_surface_get_stride (dest);
-
-  info->src_tiles      = tiles;
-  info->src_is_premult = is_premult;
-
-  info->scalex      = shell->scale_x * (1 << level);
-  info->scaley      = shell->scale_y * (1 << level);
-
-  info->full_scalex = shell->scale_x;
-  info->full_scaley = shell->scale_y;
-
-  /* use Bresenham like stepping */
-  info->x_dest_inc  = shell->x_dest_inc >> level;
-  info->x_src_dec   = shell->x_src_dec;
-
-  info->dx_start    = ((gint64) info->x_dest_inc * info->x
-                       + info->x_dest_inc / 2);
-
-  info->src_x       = info->dx_start / info->x_src_dec;
-  info->dx_start    = info->dx_start % info->x_src_dec;
-
-  /* same for y */
-  info->y_dest_inc  = shell->y_dest_inc >> level;
-  info->y_src_dec   = shell->y_src_dec;
-
-  info->dy_start    = ((gint64) info->y_dest_inc * info->y
-                       + info->y_dest_inc / 2);
-
-  info->src_y       = info->dy_start / info->y_src_dec;
-  info->dy_start    = info->dy_start % info->y_src_dec;
-
-  /* make sure that the footprint is in the range 256..512 */
-  info->footprint_x = info->x_src_dec;
-  info->footshift_x = 0;
-  while (info->footprint_x > 512)
-    {
-      info->footprint_x >>= 1;
-      info->footshift_x --;
-    }
-  while (info->footprint_x < 256)
-    {
-      info->footprint_x <<= 1;
-      info->footshift_x ++;
-    }
-
-  info->footprint_y = info->y_src_dec;
-  info->footshift_y = 0;
-  while (info->footprint_y > 512)
-    {
-      info->footprint_y >>= 1;
-      info->footshift_y --;
-    }
-  while (info->footprint_y < 256)
-    {
-      info->footprint_y <<= 1;
-      info->footshift_y ++;
-    }
-
-  switch (shell->display->config->zoom_quality)
-    {
-    case GIMP_ZOOM_QUALITY_LOW:
-      info->zoom_quality = GIMP_DISPLAY_ZOOM_FAST;
-      break;
-
-    case GIMP_ZOOM_QUALITY_HIGH:
-      info->zoom_quality = GIMP_DISPLAY_ZOOM_PIXEL_AA;
-      break;
-    }
-}
-
-/* This version assumes that the src data is already pre-multiplied. */
-static inline void
-box_filter (const guint    left_weight,
-            const guint    center_weight,
-            const guint    right_weight,
-            const guint    top_weight,
-            const guint    middle_weight,
-            const guint    bottom_weight,
-            const guchar **src,   /* the 9 surrounding source pixels */
-            guchar        *dest,
-            const gint     bpp)
-{
-  const guint sum = ((left_weight + center_weight + right_weight) *
-                     (top_weight + middle_weight + bottom_weight));
-  gint i;
-
-  for (i = 0; i < bpp; i++)
-    {
-      dest[i] = ( left_weight   * ((src[0][i] * top_weight) +
-                                   (src[3][i] * middle_weight) +
-                                   (src[6][i] * bottom_weight))
-                + center_weight * ((src[1][i] * top_weight) +
-                                   (src[4][i] * middle_weight) +
-                                   (src[7][i] * bottom_weight))
-                + right_weight  * ((src[2][i] * top_weight) +
-                                   (src[5][i] * middle_weight) +
-                                   (src[8][i] * bottom_weight))) / sum;
-    }
-}
-
-/* This version assumes that the src data is not pre-multipled.
- * It creates pre-multiplied output though.
- */
-static inline void
-box_filter_premult (const guint    left_weight,
-                    const guint    center_weight,
-                    const guint    right_weight,
-                    const guint    top_weight,
-                    const guint    middle_weight,
-                    const guint    bottom_weight,
-                    const guchar **src,   /* the 9 surrounding source pixels */
-                    guchar        *dest,
-                    const gint     bpp)
-{
-  const guint sum = ((left_weight + center_weight + right_weight) *
-                     (top_weight + middle_weight + bottom_weight)) >> 4;
-
-  switch (bpp)
-    {
-      case 4:
-#define ALPHA 3
-        {
-          const guint factors[9] =
-            {
-              (src[1][ALPHA] * top_weight)    >> 4,
-              (src[4][ALPHA] * middle_weight) >> 4,
-              (src[7][ALPHA] * bottom_weight) >> 4,
-              (src[2][ALPHA] * top_weight)    >> 4,
-              (src[5][ALPHA] * middle_weight) >> 4,
-              (src[8][ALPHA] * bottom_weight) >> 4,
-              (src[0][ALPHA] * top_weight)    >> 4,
-              (src[3][ALPHA] * middle_weight) >> 4,
-              (src[6][ALPHA] * bottom_weight) >> 4
-            };
-
-          const guint a =
-            (center_weight * (factors[0] + factors[1] + factors[2]) +
-             right_weight  * (factors[3] + factors[4] + factors[5]) +
-             left_weight   * (factors[6] + factors[7] + factors[8]));
-
-          guint i;
-
-          for (i = 0; i < ALPHA; i++)
-            {
-              dest[i] = ((center_weight * (factors[0] * src[1][i] +
-                                           factors[1] * src[4][i] +
-                                           factors[2] * src[7][i]) +
-
-                          right_weight  * (factors[3] * src[2][i] +
-                                           factors[4] * src[5][i] +
-                                           factors[5] * src[8][i]) +
-
-                          left_weight   * (factors[6] * src[0][i] +
-                                           factors[7] * src[3][i] +
-                                           factors[8] * src[6][i])) / sum) >> 8;
-            }
-
-          dest[ALPHA] = (a + (sum >> 1)) / sum;
-        }
-#undef ALPHA
-        break;
-
-      case 2:
-#define ALPHA 1
-
-        /* NOTE: this is a copy and paste of the code above, ALPHA changes
-         *       the behavior in all needed ways.
-         */
-        {
-          const guint factors[9] =
-            {
-              (src[1][ALPHA] * top_weight)    >> 4,
-              (src[4][ALPHA] * middle_weight) >> 4,
-              (src[7][ALPHA] * bottom_weight) >> 4,
-              (src[2][ALPHA] * top_weight)    >> 4,
-              (src[5][ALPHA] * middle_weight) >> 4,
-              (src[8][ALPHA] * bottom_weight) >> 4,
-              (src[0][ALPHA] * top_weight)    >> 4,
-              (src[3][ALPHA] * middle_weight) >> 4,
-              (src[6][ALPHA] * bottom_weight) >> 4
-            };
-
-          const guint a =
-            (center_weight * (factors[0] + factors[1] + factors[2]) +
-             right_weight  * (factors[3] + factors[4] + factors[5]) +
-             left_weight   * (factors[6] + factors[7] + factors[8]));
-
-          guint i;
-
-          for (i = 0; i < ALPHA; i++)
-            {
-              dest[i] = ((center_weight * (factors[0] * src[1][i] +
-                                           factors[1] * src[4][i] +
-                                           factors[2] * src[7][i]) +
-
-                          right_weight  * (factors[3] * src[2][i] +
-                                           factors[4] * src[5][i] +
-                                           factors[5] * src[8][i]) +
-
-                          left_weight   * (factors[6] * src[0][i] +
-                                           factors[7] * src[3][i] +
-                                           factors[8] * src[6][i])) / sum) >> 8;
-            }
-
-          dest[ALPHA] = (a + (sum >> 1)) / sum;
-        }
-#undef ALPHA
-        break;
-
-      default:
-        g_warning ("bpp=%i not implemented as box filter", bpp);
-        break;
-    }
-}
-
-
-/* fast paths */
-static const guchar * render_image_tile_fault_one_row  (RenderInfo *info);
-static const guchar * render_image_tile_fault_nearest  (RenderInfo *info);
-
-/*  012 <- this is the order of the numbered source tiles / pixels.
- *  345    for the 3x3 neighbourhoods.
- *  678
- */
-
-/* Function to render a horizontal line of view data.  The data
- * returned from this function has the alpha channel pre-multiplied.
- */
-static const guchar *
-render_image_tile_fault (RenderInfo *info)
-{
-  Tile         *tile[9];
-  const guchar *src[9];
-
-  guchar       *dest;
-  gint          width;
-  gint          tilex0;   /* the current x-tile indice used for the middle
-                             sample pair*/
-  gint          tilex1;   /* the current x-tile indice used for the right
-                             sample pair */
-  gint          tilexL;   /* the current x-tile indice used for the left
-                             sample pair */
-  gint          bpp;
-  gint          dx;
-  gint          src_x;
-  gint          skipped;
-
-  guint         left_weight;
-  guint         center_weight;
-  guint         right_weight;
-
-  guint         top_weight;
-  guint         middle_weight;
-  guint         bottom_weight;
-
-  guint         source_width;
-  guint         source_height;
-
-  source_width  = tile_manager_width (info->src_tiles);
-  source_height = tile_manager_height (info->src_tiles);
-
-  /* dispatch to fast path functions on special conditions */
-  if ((info->zoom_quality & GIMP_DISPLAY_ZOOM_FAST)
-
-      /* use nearest neighbour for exact levels */
-      || (info->scalex == 1.0 &&
-          info->scaley == 1.0)
-
-      /* or when we're larger than 1.0 and not using any AA */
-      || (info->full_scalex > 1.0 &&
-          info->full_scaley > 1.0 &&
-          (! (info->zoom_quality & GIMP_DISPLAY_ZOOM_PIXEL_AA)))
-
-      /* or at any point when both scale factors are greater or equal to 200% */
-      || (info->full_scalex >= 2.0 &&
-          info->full_scaley >= 2.0 )
-
-      /* or when we're scaling a 1bpp texture, this code-path seems to be
-       * invoked when interacting with SIOX which uses a palletized drawable
-       */
-      || (tile_manager_bpp (info->src_tiles)==1)
-      )
-    {
-      return render_image_tile_fault_nearest (info);
-    }
-  else if (((info->src_y)     & ~(TILE_WIDTH -1)) ==
-           ((info->src_y + 1) & ~(TILE_WIDTH -1)) &&
-           ((info->src_y)     & ~(TILE_WIDTH -1)) ==
-           ((info->src_y - 1) & ~(TILE_WIDTH -1)) &&
-           (info->src_y + 1 < source_height)
-          )
-    {
-      /* all the tiles needed are in a single row, use a tile iterator
-       * optimized for this case. */
-      return render_image_tile_fault_one_row (info);
-    }
-
-  top_weight    = MAX (info->footprint_y / 2,
-                       info->footshift_y > 0 ? info->dy << info->footshift_y
-                                             : info->dy >> -info->footshift_y)
-                  - (info->footshift_y > 0 ? info->dy << info->footshift_y
-                                           : info->dy >> -info->footshift_y);
-
-  bottom_weight = MAX (info->footprint_y / 2,
-                       info->footshift_y > 0 ? info->dy << info->footshift_y
-                                             : info->dy >> -info->footshift_y)
-                  - info->footprint_y / 2;
-
-  middle_weight = info->footprint_y - top_weight - bottom_weight;
-
-  tile[4] = tile_manager_get_tile (info->src_tiles,
-                                   info->src_x, info->src_y,
-                                   TRUE, FALSE);
-  tile[7] = tile_manager_get_tile (info->src_tiles,
-                                   info->src_x, info->src_y + 1,
-                                   TRUE, FALSE);
-  tile[1] = tile_manager_get_tile (info->src_tiles,
-                                   info->src_x, info->src_y - 1,
-                                   TRUE, FALSE);
-
-  tile[5] = tile_manager_get_tile (info->src_tiles,
-                                   info->src_x + 1, info->src_y,
-                                   TRUE, FALSE);
-  tile[8] = tile_manager_get_tile (info->src_tiles,
-                                   info->src_x + 1, info->src_y + 1,
-                                   TRUE, FALSE);
-  tile[2] = tile_manager_get_tile (info->src_tiles,
-                                   info->src_x + 1, info->src_y - 1,
-                                   TRUE, FALSE);
-
-  tile[3] = tile_manager_get_tile (info->src_tiles,
-                                   info->src_x - 1, info->src_y,
-                                   TRUE, FALSE);
-  tile[6] = tile_manager_get_tile (info->src_tiles,
-                                   info->src_x - 1, info->src_y + 1,
-                                   TRUE, FALSE);
-  tile[0] = tile_manager_get_tile (info->src_tiles,
-                                   info->src_x - 1, info->src_y - 1,
-                                   TRUE, FALSE);
-
-  g_return_val_if_fail (tile[4] != NULL, tile_buf);
-
-  src[4] = tile_data_pointer (tile[4], info->src_x, info->src_y);
-
-  if (tile[5])
-    {
-      src[5] = tile_data_pointer (tile[5], info->src_x + 1, info->src_y);
-    }
-  else
-    {
-      src[5] = src[4];  /* reusing existing pixel data */
-    }
-
-  if (tile[7])
-    {
-      src[7] = tile_data_pointer (tile[7], info->src_x, info->src_y + 1);
-    }
-  else
-    {
-      src[7] = src[4];  /* reusing existing pixel data */
-    }
-
-  if (tile[1])
-    {
-      src[1] = tile_data_pointer (tile[1], info->src_x, info->src_y - 1);
-    }
-  else
-    {
-      src[1] = src[4];  /* reusing existing pixel data */
-    }
-
-  if (tile[8])
-    {
-      src[8] = tile_data_pointer (tile[8], info->src_x + 1, info->src_y + 1);
-    }
-  else
-    {
-      src[8] = src[5];  /* reusing existing pixel data */
-    }
-
-  if (tile[0])
-    {
-      src[0] = tile_data_pointer (tile[0], info->src_x - 1, info->src_y - 1);
-    }
-  else
-    {
-      src[0] = src[1];  /* reusing existing pixel data */
-    }
-
-  if (tile[2])
-    {
-      src[2] = tile_data_pointer (tile[2], info->src_x + 1, info->src_y - 1);
-    }
-  else
-    {
-      src[2] = src[4];  /* reusing existing pixel data */
-    }
-
-  if (tile[3])
-    {
-      src[3] = tile_data_pointer (tile[3], info->src_x - 1, info->src_y);
-    }
-  else
-    {
-      src[3] = src[4];  /* reusing existing pixel data */
-    }
-
-  if (tile[6])
-    {
-      src[6] = tile_data_pointer (tile[6], info->src_x - 1, info->src_y + 1);
-    }
-  else
-    {
-      src[6] = src[7];  /* reusing existing pixel data */
-    }
-
-  bpp    = tile_manager_bpp (info->src_tiles);
-  dest   = tile_buf;
-
-  dx     = info->dx_start;
-  src_x  = info->src_x;
-
-  width  = info->w;
-
-  tilex0 = info->src_x / TILE_WIDTH;
-  tilex1 = (info->src_x + 1) / TILE_WIDTH;
-  tilexL = (info->src_x - 1) / TILE_WIDTH;
-
-  do
-    {
-      /* we're dealing with unsigneds here, be extra careful */
-      left_weight  = MAX (info->footprint_x / 2,
-                          info->footshift_x > 0 ? dx << info->footshift_x
-                                                : dx >> -info->footshift_x)
-                     - (info->footshift_x > 0 ? dx << info->footshift_x
-                                              : dx >> -info->footshift_x);
-
-      right_weight = MAX (info->footprint_x / 2,
-                          info->footshift_x > 0 ? dx << info->footshift_x
-                                                : dx >> -info->footshift_x)
-                     - info->footprint_x / 2;
-
-      center_weight = info->footprint_x - left_weight - right_weight;
-
-      if (src_x + 1 >= source_width)
-        {
-           src[2] = src[1];
-           src[5] = src[4];
-           src[8] = src[7];
-        }
-
-      if (info->src_y + 1 >= source_height)
-        {
-           src[6] = src[3];
-           src[7] = src[4];
-           src[8] = src[5];
-        }
-
-      if (info->src_is_premult)
-        box_filter (left_weight, center_weight, right_weight,
-                    top_weight, middle_weight, bottom_weight,
-                    src, dest, bpp);
-      else
-        box_filter_premult (left_weight, center_weight, right_weight,
-                            top_weight, middle_weight, bottom_weight,
-                            src, dest, bpp);
-
-      dest += bpp;
-
-      dx += info->x_dest_inc;
-      skipped = dx / info->x_src_dec;
-
-      if (skipped)
-        {
-          dx -= skipped * info->x_src_dec;
-
-          /* if we changed integer source pixel coordinates in the source
-           * buffer, make sure the src pointers (and their backing tiles) are
-           * correct
-           */
-
-          if (src[0] != src[1])
-            {
-              src[0] += skipped * bpp;
-            }
-          else
-            {
-              tilexL = -1;  /* this forces a refetch of the left most source
-                               samples */
-            }
-
-          if (src[3] != src[4])
-            {
-              src[3] += skipped * bpp;
-            }
-          else
-            {
-              tilexL = -1;  /* this forces a refetch of the left most source
-                               samples */
-            }
-
-          if (src[6] != src[7])
-            {
-              src[6] += skipped * bpp;
-            }
-          else
-            {
-              tilexL = -1;  /* this forces a refetch of the left most source
-                               samples */
-            }
-
-          src[1] += skipped * bpp;
-          src[4] += skipped * bpp;
-          src[7] += skipped * bpp;
-
-          src[5] += skipped * bpp;
-          src[8] += skipped * bpp;
-          src[2] += skipped * bpp;
-
-
-          src_x += skipped;
-
-          if ((src_x / TILE_WIDTH) != tilex0)
-            {
-              tile_release (tile[4], FALSE);
-
-              if (tile[7])
-                tile_release (tile[7], FALSE);
-              if (tile[1])
-                tile_release (tile[1], FALSE);
-
-              tilex0 += 1;
-
-              tile[4] = tile_manager_get_tile (info->src_tiles,
-                                               src_x, info->src_y,
-                                               TRUE, FALSE);
-              tile[7] = tile_manager_get_tile (info->src_tiles,
-                                               src_x, info->src_y + 1,
-                                               TRUE, FALSE);
-              tile[1] = tile_manager_get_tile (info->src_tiles,
-                                               src_x, info->src_y - 1,
-                                               TRUE, FALSE);
-              if (! tile[4])
-                goto done;
-
-              src[4] = tile_data_pointer (tile[4], src_x, info->src_y);
-
-              if (! tile[7])
-                {
-                  src[7] = src[4];
-                }
-              else
-                {
-                  src[7] = tile_data_pointer (tile[7],
-                                              src_x, info->src_y + 1);
-                }
-
-              if (! tile[1])
-                {
-                  src[1] = src[4];
-                }
-              else
-                {
-                  src[1] = tile_data_pointer (tile[1],
-                                              src_x, info->src_y - 1);
-                }
-            }
-
-          if (((src_x + 1) / TILE_WIDTH) != tilex1)
-            {
-              if (tile[5])
-                tile_release (tile[5], FALSE);
-              if (tile[8])
-                tile_release (tile[8], FALSE);
-              if (tile[2])
-                tile_release (tile[2], FALSE);
-
-              tilex1 += 1;
-
-              tile[5] = tile_manager_get_tile (info->src_tiles,
-                                               src_x + 1, info->src_y,
-                                               TRUE, FALSE);
-              tile[8] = tile_manager_get_tile (info->src_tiles,
-                                               src_x + 1, info->src_y + 1,
-                                               TRUE, FALSE);
-              tile[2] = tile_manager_get_tile (info->src_tiles,
-                                               src_x + 1, info->src_y - 1,
-                                               TRUE, FALSE);
-
-              if (! tile[5])
-                {
-                  src[5] = src[4];
-                }
-              else
-                {
-                  src[5] = tile_data_pointer (tile[5],
-                                              src_x + 1, info->src_y);
-                }
-
-              if (! tile[8])
-                {
-                  src[8] = src[7];
-                }
-              else
-                {
-                  src[8] = tile_data_pointer (tile[8],
-                                              src_x + 1, info->src_y + 1);
-                }
-
-              if (! tile[2])
-                {
-                  src[2] = src[1];
-                }
-              else
-                {
-                  src[2] = tile_data_pointer (tile[2],
-                                              src_x + 1, info->src_y - 1);
-                }
-            }
-
-          if (((src_x - 1) / TILE_WIDTH) != tilexL)
-            {
-              if (tile[0])
-                tile_release (tile[0], FALSE);
-              if (tile[3])
-                tile_release (tile[3], FALSE);
-              if (tile[6])
-                tile_release (tile[6], FALSE);
-
-              tilexL += 1;
-
-              tile[0] = tile_manager_get_tile (info->src_tiles,
-                                               src_x - 1, info->src_y - 1,
-                                               TRUE, FALSE);
-              tile[3] = tile_manager_get_tile (info->src_tiles,
-                                               src_x - 1, info->src_y,
-                                               TRUE, FALSE);
-              tile[6] = tile_manager_get_tile (info->src_tiles,
-                                               src_x - 1, info->src_y + 1,
-                                               TRUE, FALSE);
-
-              if (! tile[3])
-                {
-                  src[3] = src[4];
-                }
-              else
-                {
-                  src[3] = tile_data_pointer (tile[3],
-                                              src_x - 1, info->src_y);
-                }
-
-              if (! tile[6])
-                {
-                  src[6] = src[7];
-                }
-              else
-                {
-                  src[6] = tile_data_pointer (tile[6],
-                                              src_x - 1, info->src_y + 1);
-                }
-
-              if (! tile[0])
-                {
-                  src[0] = src[1];
-                }
-              else
-                {
-                  src[0] = tile_data_pointer (tile[0],
-                                              src_x - 1, info->src_y - 1);
-                }
-            }
-
-        }
-    }
-  while (--width);
-
-done:
-  for (dx = 0; dx < 9; dx++)
-    if (tile[dx])
-      tile_release (tile[dx], FALSE);
-
-  return tile_buf;
-}
-
-static const guchar *
-render_image_tile_fault_one_row (RenderInfo *info)
-{
-  /* NOTE: there are some additional overhead that can be factored out
-   * in the tile administration of this fast path
-   */
-
-  Tile         *tile[3];
-
-  const guchar *src[9];
-
-  guchar       *dest;
-  gint          width;
-  gint          tilex0;   /* the current x-tile indice used for the middle
-                             sample pair*/
-  gint          tilex1;   /* the current x-tile indice used for the right
-                             sample pair */
-  gint          tilexL;   /* the current x-tile indice used for the left
-                             sample pair */
-  gint          bpp;
-  gint          dx;
-  gint          src_x;
-  gint          skipped;
-
-  guint         left_weight;
-  guint         center_weight;
-  guint         right_weight;
-
-  guint         top_weight;
-  guint         middle_weight;
-  guint         bottom_weight;
-
-  guint         source_width;
-
-  source_width = tile_manager_width (info->src_tiles);
-
-  top_weight    = MAX (info->footprint_y / 2,
-                       info->footshift_y > 0 ? info->dy << info->footshift_y
-                                             : info->dy >> -info->footshift_y)
-                  - (info->footshift_y > 0 ? info->dy << info->footshift_y
-                                           : info->dy >> -info->footshift_y);
-
-  bottom_weight = MAX (info->footprint_y / 2,
-                       info->footshift_y > 0 ? info->dy << info->footshift_y
-                                             : info->dy >> -info->footshift_y)
-                  - info->footprint_y / 2;
-
-  middle_weight = info->footprint_y - top_weight - bottom_weight;
-
-  tile[0] = tile_manager_get_tile (info->src_tiles,
-                                   info->src_x, info->src_y, TRUE, FALSE);
-
-  tile[1] = tile_manager_get_tile (info->src_tiles,
-                                   info->src_x + 1, info->src_y, TRUE, FALSE);
-
-  tile[2] = tile_manager_get_tile (info->src_tiles,
-                                   info->src_x - 1, info->src_y, TRUE, FALSE);
-
-  g_return_val_if_fail (tile[0] != NULL, tile_buf);
-
-  src[4] = tile_data_pointer (tile[0], info->src_x, info->src_y);
-  src[7] = tile_data_pointer (tile[0], info->src_x, info->src_y + 1);
-
-  if (tile[1])
-    {
-      src[5] = tile_data_pointer (tile[1], info->src_x + 1, info->src_y);
-      src[8] = tile_data_pointer (tile[1], info->src_x + 1, info->src_y + 1);
-    }
-  else
-    {
-      src[5] = src[4];  /* reusing existing pixel data */
-      src[8] = src[5];  /* reusing existing pixel data */
-    }
-
-  if (tile[0])
-    {
-      src[1] = tile_data_pointer (tile[0], info->src_x, info->src_y - 1);
-    }
-  else
-    {
-      src[1] = src[4];  /* reusing existing pixel data */
-    }
-
-  if (tile[2])
-    {
-      src[0] = tile_data_pointer (tile[2], info->src_x - 1, info->src_y - 1);
-    }
-  else
-    {
-      src[0] = src[1];  /* reusing existing pixel data */
-    }
-
-  if (tile[1])
-    {
-      src[2] = tile_data_pointer (tile[1], info->src_x + 1, info->src_y - 1);
-    }
-  else
-    {
-      src[2] = src[4];  /* reusing existing pixel data */
-    }
-
-  if (tile[2])
-    {
-      src[3] = tile_data_pointer (tile[2], info->src_x - 1, info->src_y);
-      src[6] = tile_data_pointer (tile[2], info->src_x - 1, info->src_y + 1);
-    }
-  else
-    {
-      src[3] = src[4];  /* reusing existing pixel data */
-      src[6] = src[7];  /* reusing existing pixel data */
-    }
-
-  bpp    = tile_manager_bpp (info->src_tiles);
-  dest   = tile_buf;
-
-  dx     = info->dx_start;
-  src_x  = info->src_x;
-
-  width  = info->w;
-
-  tilex0 = info->src_x / TILE_WIDTH;
-  tilex1 = (info->src_x + 1) / TILE_WIDTH;
-  tilexL = (info->src_x - 1) / TILE_WIDTH;
-
-  do
-    {
-      left_weight  = MAX (info->footprint_x / 2,
-                          info->footshift_x > 0 ? dx << info->footshift_x
-                                                : dx >> -info->footshift_x)
-                     - (info->footshift_x > 0 ? dx << info->footshift_x
-                                              : dx >> -info->footshift_x);
-
-      right_weight = MAX (info->footprint_x / 2,
-                          info->footshift_x > 0 ? dx << info->footshift_x
-                                                : dx >> -info->footshift_x)
-                     - info->footprint_x / 2;
-
-      center_weight = info->footprint_x - left_weight - right_weight;
-
-      if (src_x + 1 >= source_width)
-        {
-          src[2] = src[1];
-          src[5] = src[4];
-          src[8] = src[7];
-        }
-
-      if (info->src_is_premult)
-        box_filter (left_weight, center_weight, right_weight,
-                    top_weight, middle_weight, bottom_weight,
-                    src, dest, bpp);
-      else
-        box_filter_premult (left_weight, center_weight, right_weight,
-                            top_weight, middle_weight, bottom_weight,
-                            src, dest, bpp);
-
-      dest += bpp;
-
-      dx += info->x_dest_inc;
-      skipped = dx / info->x_src_dec;
-
-      if (skipped)
-        {
-          dx -= skipped * info->x_src_dec;
-
-          /* if we changed integer source pixel coordinates in the source
-           * buffer, make sure the src pointers (and their backing tiles) are
-           * correct
-           */
-
-          if (src[0] != src[1])
-            {
-              src[0] += skipped * bpp;
-            }
-          else
-            {
-              tilexL = -1;  /* this forces a refetch of the left most source
-                               samples */
-            }
-
-          if (src[3] != src[4])
-            {
-              src[3] += skipped * bpp;
-            }
-          else
-            {
-              tilexL = -1;  /* this forces a refetch of the left most source
-                               samples */
-            }
-
-          if (src[6] != src[7])
-            {
-              src[6] += skipped * bpp;
-            }
-          else
-            {
-              tilexL = -1;  /* this forces a refetch of the left most source
-                               samples */
-            }
-
-          src[1] += skipped * bpp;
-          src[4] += skipped * bpp;
-          src[7] += skipped * bpp;
-
-          src[5] += skipped * bpp;
-          src[8] += skipped * bpp;
-          src[2] += skipped * bpp;
-
-
-          src_x += skipped;
-
-          if ((src_x / TILE_WIDTH) != tilex0)
-            {
-              tile_release (tile[0], FALSE);
-
-              tilex0 += 1;
-
-              tile[0] = tile_manager_get_tile (info->src_tiles,
-                                               src_x, info->src_y, TRUE, FALSE);
-              if (! tile[0])
-                goto done;
-
-              src[4] = tile_data_pointer (tile[0], src_x, info->src_y);
-              src[7] = tile_data_pointer (tile[0], src_x, info->src_y + 1);
-              src[1] = tile_data_pointer (tile[0], src_x, info->src_y - 1);
-            }
-
-          if (((src_x + 1) / TILE_WIDTH) != tilex1)
-            {
-              if (tile[1])
-                tile_release (tile[1], FALSE);
-
-              tilex1 += 1;
-
-              tile[1] = tile_manager_get_tile (info->src_tiles,
-                                               src_x + 1, info->src_y,
-                                               TRUE, FALSE);
-
-              if (! tile[1])
-                {
-                  src[5] = src[4];
-                  src[8] = src[7];
-                  src[2] = src[1];
-                }
-              else
-                {
-                  src[5] = tile_data_pointer (tile[1],
-                                              src_x + 1, info->src_y);
-                  src[8] = tile_data_pointer (tile[1],
-                                              src_x + 1, info->src_y + 1);
-                  src[2] = tile_data_pointer (tile[1],
-                                              src_x + 1, info->src_y - 1);
-                }
-            }
-
-          if (((src_x - 1) / TILE_WIDTH) != tilexL)
-            {
-              if (tile[2])
-                tile_release (tile[2], FALSE);
-
-              tilexL += 1;
-
-              tile[2] = tile_manager_get_tile (info->src_tiles,
-                                               src_x - 1, info->src_y,
-                                               TRUE, FALSE);
-
-              if (! tile[2])
-                {
-                  src[3] = src[4];
-                  src[6] = src[7];
-                  src[0] = src[1];
-                }
-              else
-                {
-                  src[3] = tile_data_pointer (tile[2],
-                                              src_x - 1, info->src_y);
-                  src[6] = tile_data_pointer (tile[2],
-                                              src_x - 1, info->src_y + 1);
-                  src[0] = tile_data_pointer (tile[2],
-                                              src_x - 1, info->src_y - 1);
-                }
-            }
-        }
-    }
-  while (--width);
-
-done:
-  for (dx = 0; dx < 3; dx++)
-    if (tile[dx])
-      tile_release (tile[dx], FALSE);
-
-  return tile_buf;
-}
-
-/* function to render a horizontal line of view data */
-static const guchar *
-render_image_tile_fault_nearest (RenderInfo *info)
-{
-  Tile         *tile;
-  const guchar *src;
-  guchar       *d;
-  gint          width;
-  gint          tilex;
-  gint          bpp;
-  gint          src_x;
-  gint64        dx;
-
-  tile = tile_manager_get_tile (info->src_tiles,
-                                info->src_x, info->src_y, TRUE, FALSE);
-
-  g_return_val_if_fail (tile != NULL, tile_buf);
-
-  src = tile_data_pointer (tile, info->src_x, info->src_y);
-
-  bpp   = tile_manager_bpp (info->src_tiles);
-
-  dx    = info->dx_start;
-
-  width = info->w;
-
-  src_x = info->src_x;
-  tilex = info->src_x / TILE_WIDTH;
-
-  d     = tile_buf;
-
-  do
-    {
-      const guchar *s = src;
-      gint          skipped;
-
-      if (info->src_is_premult)
-        {
-          switch (bpp)
-            {
-            case 4:
-              *d++ = *s++;
-            case 3:
-              *d++ = *s++;
-            case 2:
-              *d++ = *s++;
-            case 1:
-              *d++ = *s++;
-            }
-        }
-      else  /* pre-multiply */
-        {
-          switch (bpp)
-            {
-            case 4:
-              d[0] = (s[0] * (s[3] + 1)) >> 8;
-              d[1] = (s[1] * (s[3] + 1)) >> 8;
-              d[2] = (s[2] * (s[3] + 1)) >> 8;
-              d[3] = s[3];
-
-              d += 4;
-              s += 4;
-              break;
-
-            case 3:
-              *d++ = *s++;
-              *d++ = *s++;
-              *d++ = *s++;
-              break;
-
-            case 2:
-              d[0] = (s[0] * (s[1] + 1)) >> 8;
-              d[1] = s[1];
-
-              d += 2;
-              s += 2;
-              break;
-
-            case 1:
-              *d++ = *s++;
-              break;
-            }
-        }
-
-      dx += info->x_dest_inc;
-      skipped = dx / info->x_src_dec;
-
-      if (skipped)
-        {
-          src += skipped * bpp;
-          src_x += skipped;
-          dx -= skipped * info->x_src_dec;
-
-          if ((src_x / TILE_WIDTH) != tilex)
-            {
-              tile_release (tile, FALSE);
-              tilex += 1;
-
-              tile = tile_manager_get_tile (info->src_tiles,
-                                            src_x, info->src_y, TRUE, FALSE);
-              if (! tile)
-                return tile_buf;
-
-              src = tile_data_pointer (tile, src_x, info->src_y);
-            }
-        }
-    }
-  while (--width);
-
-  tile_release (tile, FALSE);
-
-  return tile_buf;
-}
diff --git a/app/gegl/Makefile.am b/app/gegl/Makefile.am
index 00f1bad..e1fa3ca 100644
--- a/app/gegl/Makefile.am
+++ b/app/gegl/Makefile.am
@@ -35,9 +35,7 @@ libappgegl_a_sources = \
 	gimp-gegl-utils.c		\
 	gimp-gegl-utils.h		\
 	gimpapplicator.c		\
-	gimpapplicator.h		\
-	gimptilebackendtilemanager.c	\
-	gimptilebackendtilemanager.h
+	gimpapplicator.h
 
 libappgegl_a_built_sources = gimp-gegl-enums.c
 
diff --git a/app/gegl/gimp-gegl-utils.c b/app/gegl/gimp-gegl-utils.c
index a37cf78..7df86c0 100644
--- a/app/gegl/gimp-gegl-utils.c
+++ b/app/gegl/gimp-gegl-utils.c
@@ -24,12 +24,9 @@
 
 #include "gimp-gegl-types.h"
 
-#include "base/tile-manager.h"
-
 #include "core/gimpprogress.h"
 
 #include "gimp-gegl-utils.h"
-#include "gimptilebackendtilemanager.h"
 
 
 const gchar *
@@ -48,84 +45,6 @@ gimp_interpolation_to_gegl_filter (GimpInterpolationType interpolation)
   return "nearest";
 }
 
-GeglBuffer *
-gimp_gegl_buffer_new (const GeglRectangle *rect,
-                      const Babl          *format)
-{
-  TileManager *tiles;
-  GeglBuffer  *buffer;
-
-  g_return_val_if_fail (rect != NULL, NULL);
-  g_return_val_if_fail (format != NULL, NULL);
-
-  tiles = tile_manager_new (rect->width, rect->height,
-                            babl_format_get_bytes_per_pixel (format));
-  buffer = gimp_tile_manager_create_buffer (tiles, format);
-  tile_manager_unref (tiles);
-
-  return buffer;
-}
-
-GeglBuffer *
-gimp_gegl_buffer_dup (GeglBuffer *buffer)
-{
-  const Babl  *format = gegl_buffer_get_format (buffer);
-  TileManager *tiles;
-  GeglBuffer  *dup;
-
-  tiles = tile_manager_new (gegl_buffer_get_width (buffer),
-                            gegl_buffer_get_height (buffer),
-                            babl_format_get_bytes_per_pixel (format));
-
-  dup = gimp_tile_manager_create_buffer (tiles, format);
-  tile_manager_unref (tiles);
-
-  gegl_buffer_copy (buffer, NULL, dup, NULL);
-
-  return dup;
-}
-
-GeglBuffer *
-gimp_tile_manager_create_buffer (TileManager *tm,
-                                 const Babl  *format)
-{
-  GeglTileBackend *backend;
-  GeglBuffer      *buffer;
-
-  backend = gimp_tile_backend_tile_manager_new (tm, format);
-  buffer = gegl_buffer_new_for_backend (NULL, backend);
-  g_object_unref (backend);
-
-  return buffer;
-}
-
-/* temp hack */
-GeglTileBackend * gegl_buffer_backend (GeglBuffer *buffer);
-
-TileManager *
-gimp_gegl_buffer_get_tiles (GeglBuffer *buffer)
-{
-  GeglTileBackend *backend;
-
-  g_return_val_if_fail (GEGL_IS_BUFFER (buffer), NULL);
-
-  backend = gegl_buffer_backend (buffer);
-
-  g_return_val_if_fail (GIMP_IS_TILE_BACKEND_TILE_MANAGER (backend), NULL);
-
-  gegl_buffer_flush (buffer);
-
-  return gimp_tile_backend_tile_manager_get_tiles (backend);
-}
-
-void
-gimp_gegl_buffer_refetch_tiles (GeglBuffer *buffer)
-{
-  g_return_if_fail (GEGL_IS_BUFFER (buffer));
-
-  gegl_tile_source_reinit (GEGL_TILE_SOURCE (buffer));
-}
-
 GeglColor *
 gimp_gegl_color_new (const GimpRGB *rgb)
 {
diff --git a/app/gegl/gimp-gegl-utils.h b/app/gegl/gimp-gegl-utils.h
index 339a1a4..c680c7b 100644
--- a/app/gegl/gimp-gegl-utils.h
+++ b/app/gegl/gimp-gegl-utils.h
@@ -22,21 +22,13 @@
 #define __GIMP_GEGL_UTILS_H__
 
 
-const gchar * gimp_interpolation_to_gegl_filter  (GimpInterpolationType  interpolation) G_GNUC_CONST;
+const gchar * gimp_interpolation_to_gegl_filter (GimpInterpolationType  interpolation) G_GNUC_CONST;
 
-GeglBuffer  * gimp_gegl_buffer_new               (const GeglRectangle   *rect,
-                                                  const Babl            *format);
-GeglBuffer  * gimp_gegl_buffer_dup               (GeglBuffer            *buffer);
+GeglColor   * gimp_gegl_color_new               (const GimpRGB         *rgb);
 
-GeglBuffer  * gimp_tile_manager_create_buffer    (TileManager           *tm,
-                                                  const Babl            *format);
-TileManager * gimp_gegl_buffer_get_tiles         (GeglBuffer            *buffer);
-void          gimp_gegl_buffer_refetch_tiles     (GeglBuffer            *buffer);
+void          gimp_gegl_progress_connect        (GeglNode              *node,
+                                                 GimpProgress          *progress,
+                                                 const gchar           *text);
 
-GeglColor   * gimp_gegl_color_new                (const GimpRGB         *rgb);
-
-void          gimp_gegl_progress_connect         (GeglNode              *node,
-                                                  GimpProgress          *progress,
-                                                  const gchar           *text);
 
 #endif /* __GIMP_GEGL_UTILS_H__ */
diff --git a/app/gegl/gimp-gegl.c b/app/gegl/gimp-gegl.c
index 396ae8f..4280e15 100644
--- a/app/gegl/gimp-gegl.c
+++ b/app/gegl/gimp-gegl.c
@@ -24,8 +24,6 @@
 
 #include "gimp-gegl-types.h"
 
-#include "base/tile.h"
-
 #include "config/gimpgeglconfig.h"
 
 #include "operations/gimp-operations.h"
@@ -58,8 +56,10 @@ gimp_gegl_init (Gimp *gimp)
 #endif
 
   g_object_set (gegl_config (),
+#if 0
                 "tile-width",  TILE_WIDTH,
                 "tile-height", TILE_HEIGHT,
+#endif
                 "cache-size",  (gint) MIN (config->tile_cache_size, G_MAXINT),
 #if 0
                 "threads",     config->num_processors,
diff --git a/app/main.c b/app/main.c
index 60ea1c9..c372aa6 100644
--- a/app/main.c
+++ b/app/main.c
@@ -45,8 +45,6 @@
 
 #include "pdb/pdb-types.h"
 
-#include "base/tile.h"
-
 #include "config/gimpconfig-dump.h"
 
 #include "core/gimp.h"
@@ -688,8 +686,10 @@ gimp_init_malloc (void)
    * An alternative to tuning this parameter would be to use
    * malloc_trim(), for example after releasing a large tile-manager.
    */
+#if 0
   mallopt (M_MMAP_THRESHOLD, TILE_WIDTH * TILE_HEIGHT);
 #endif
+#endif
 }
 
 static void
diff --git a/app/tests.c b/app/tests.c
index 47d149e..955f374 100644
--- a/app/tests.c
+++ b/app/tests.c
@@ -32,8 +32,6 @@
 
 #include "widgets/gimpsessioninfo.h"
 
-#include "base/base.h"
-
 #include "config/gimpgeglconfig.h"
 
 #include "core/gimp.h"
@@ -75,9 +73,6 @@ gimp_init_for_testing (void)
 
   gegl_init(NULL, NULL);
   gimp_gegl_init (gimp);
-  base_init (GIMP_GEGL_CONFIG (gimp->config),
-             FALSE /*be_verbose*/,
-             FALSE /*use_cpu_accel*/);
   gimp_initialize (gimp, gimp_status_func_dummy);
   gimp_restore (gimp, gimp_status_func_dummy);
 
@@ -108,9 +103,6 @@ gimp_init_for_gui_testing_internal (gboolean     show_gui,
   gimp_set_show_gui (gimp, show_gui);
   units_init (gimp);
   gimp_load_config (gimp, gimprc, NULL);
-  base_init (GIMP_GEGL_CONFIG (gimp->config),
-             FALSE /*be_verbose*/,
-             FALSE /*use_cpu_accel*/);
   gegl_init(NULL, NULL);
   gimp_gegl_init (gimp);
   gui_init (gimp, TRUE);
diff --git a/app/text/gimptextlayer.c b/app/text/gimptextlayer.c
index 0c6a6f6..a551b35 100644
--- a/app/text/gimptextlayer.c
+++ b/app/text/gimptextlayer.c
@@ -587,8 +587,8 @@ gimp_text_layer_render (GimpTextLayer *layer)
     {
       GeglBuffer *new_buffer;
 
-      new_buffer = gimp_gegl_buffer_new (GEGL_RECTANGLE (0, 0, width, height),
-                                         gimp_drawable_get_format (drawable));
+      new_buffer = gegl_buffer_new (GEGL_RECTANGLE (0, 0, width, height),
+                                    gimp_drawable_get_format (drawable));
       gimp_drawable_set_buffer (drawable, FALSE, NULL, new_buffer);
       g_object_unref (new_buffer);
 
diff --git a/configure.ac b/configure.ac
index 453b87e..93b9f71 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2155,7 +2155,6 @@ libgimpthumb/Makefile
 libgimpwidgets/Makefile
 app/Makefile
 app/actions/Makefile
-app/base/Makefile
 app/config/Makefile
 app/core/Makefile
 app/operations/Makefile
@@ -2167,7 +2166,6 @@ app/file/Makefile
 app/gui/Makefile
 app/menus/Makefile
 app/paint/Makefile
-app/paint-funcs/Makefile
 app/pdb/Makefile
 app/plug-in/Makefile
 app/text/Makefile



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]