[gimp/daniel-master] app: Set Gimp specific TileHandler properties



commit 34844e5f96e27372d8c66ec014d1467ad37a7ff7
Author: Daniel Sabo <DanielSabo gmail com>
Date:   Tue Jan 28 18:23:44 2014 -0800

    app: Set Gimp specific TileHandler properties
    
    Remove a dependency on GEGL setting Gimp specific properties
    on custom tile handlers.

 app/core/gimpprojection.c            |    2 +-
 app/gegl/gimptilehandlerprojection.c |   15 +++++++++++++++
 app/gegl/gimptilehandlerprojection.h |    2 ++
 3 files changed, 18 insertions(+), 1 deletions(-)
---
diff --git a/app/core/gimpprojection.c b/app/core/gimpprojection.c
index f22124c..0486eb0 100644
--- a/app/core/gimpprojection.c
+++ b/app/core/gimpprojection.c
@@ -340,7 +340,7 @@ gimp_projection_get_buffer (GimpPickable *pickable)
 
       proj->validate_handler = gimp_tile_handler_projection_new (graph,
                                                                  width, height);
-      gegl_buffer_add_handler (proj->buffer, proj->validate_handler);
+      gimp_tile_handler_projection_assign (proj->validate_handler, proj->buffer);
 
       /*  This used to call gimp_tile_handler_projection_invalidate()
        *  which forced the entire projection to be constructed in one
diff --git a/app/gegl/gimptilehandlerprojection.c b/app/gegl/gimptilehandlerprojection.c
index 489a652..26d50c8 100644
--- a/app/gegl/gimptilehandlerprojection.c
+++ b/app/gegl/gimptilehandlerprojection.c
@@ -305,6 +305,21 @@ gimp_tile_handler_projection_new (GeglNode *graph,
 }
 
 void
+gimp_tile_handler_projection_assign     (GimpTileHandlerProjection *projection,
+                                         GeglBuffer                *buffer)
+{
+  gegl_buffer_add_handler (buffer, projection);
+
+  g_object_get (buffer,
+                "format",      &projection->format,
+                "tile-width",  &projection->tile_width,
+                "tile-height", &projection->tile_height,
+                NULL);
+
+  gimp_tile_handler_projection_update_max_z (projection);
+}
+
+void
 gimp_tile_handler_projection_invalidate (GimpTileHandlerProjection *projection,
                                          gint                       x,
                                          gint                       y,
diff --git a/app/gegl/gimptilehandlerprojection.h b/app/gegl/gimptilehandlerprojection.h
index e1c6231..2fca682 100644
--- a/app/gegl/gimptilehandlerprojection.h
+++ b/app/gegl/gimptilehandlerprojection.h
@@ -63,6 +63,8 @@ GeglTileHandler * gimp_tile_handler_projection_new        (GeglNode
                                                            gint                       proj_width,
                                                            gint                       proj_height);
 
+void              gimp_tile_handler_projection_assign     (GimpTileHandlerProjection *projection,
+                                                           GeglBuffer                *buffer);
 void              gimp_tile_handler_projection_invalidate (GimpTileHandlerProjection *projection,
                                                            gint                       x,
                                                            gint                       y,


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