app: move new get_buffer() functions around; some general cleanup
This commit is contained in:
@ -28,8 +28,7 @@
|
||||
|
||||
#include "base/tile-manager.h"
|
||||
|
||||
#include "gegl/gimptilebackendtilemanager.h"
|
||||
|
||||
#include "gegl/gimp-gegl-utils.h"
|
||||
|
||||
#include "gimpdrawable.h"
|
||||
#include "gimpdrawable-operation.h"
|
||||
@ -148,8 +147,9 @@ gimp_drawable_apply_operation_private (GimpDrawable *drawable,
|
||||
"dont-cache", TRUE,
|
||||
NULL);
|
||||
|
||||
inbuf = gimp_drawable_get_gegl_buffer (drawable, FALSE);
|
||||
inbuf = gimp_drawable_get_buffer (drawable, FALSE);
|
||||
outbuf = gimp_tile_manager_get_gegl_buffer (dest_tiles, TRUE);
|
||||
|
||||
input = gegl_node_new_child (gegl,
|
||||
"operation", "buffer-source",
|
||||
"buffer", inbuf,
|
||||
|
@ -1456,6 +1456,16 @@ gimp_drawable_init_src_region (GimpDrawable *drawable,
|
||||
*temp_tiles = NULL;
|
||||
}
|
||||
|
||||
GeglBuffer *
|
||||
gimp_drawable_get_buffer (GimpDrawable *drawable,
|
||||
gboolean write)
|
||||
{
|
||||
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), NULL);
|
||||
|
||||
return gimp_tile_manager_get_gegl_buffer (gimp_drawable_get_tiles (drawable),
|
||||
write);
|
||||
}
|
||||
|
||||
TileManager *
|
||||
gimp_drawable_get_tiles (GimpDrawable *drawable)
|
||||
{
|
||||
|
@ -178,6 +178,8 @@ void gimp_drawable_init_src_region (GimpDrawable *drawable,
|
||||
gint height,
|
||||
TileManager **temp_tiles);
|
||||
|
||||
GeglBuffer * gimp_drawable_get_buffer (GimpDrawable *drawable,
|
||||
gboolean write);
|
||||
TileManager * gimp_drawable_get_tiles (GimpDrawable *drawable);
|
||||
void gimp_drawable_set_tiles (GimpDrawable *drawable,
|
||||
gboolean push_undo,
|
||||
|
@ -44,7 +44,7 @@
|
||||
|
||||
#include "paint-funcs/paint-funcs.h"
|
||||
|
||||
#include "gegl/gimptilebackendtilemanager.h"
|
||||
#include "gegl/gimp-gegl-utils.h"
|
||||
|
||||
#include "gimpdrawable.h"
|
||||
#include "gimpdrawable-shadow.h"
|
||||
@ -803,12 +803,13 @@ gimp_image_map_data_written (GObject *operation,
|
||||
const GeglRectangle *extent,
|
||||
GimpImageMap *image_map)
|
||||
{
|
||||
PixelRegion srcPR;
|
||||
PixelRegion destPR;
|
||||
GimpImage *image;
|
||||
PixelRegion srcPR;
|
||||
PixelRegion destPR;
|
||||
|
||||
if (!gimp_channel_is_empty (
|
||||
gimp_image_get_mask (
|
||||
gimp_item_get_image (GIMP_ITEM (image_map->drawable)))))
|
||||
image = gimp_item_get_image (GIMP_ITEM (image_map->drawable));
|
||||
|
||||
if (! gimp_channel_is_empty (gimp_image_get_mask (image)))
|
||||
{
|
||||
/* Reset to initial drawable conditions. */
|
||||
pixel_region_init (&srcPR, image_map->undo_tiles,
|
||||
|
@ -27,6 +27,7 @@
|
||||
#include "base/tile-manager.h"
|
||||
|
||||
#include "gimp-gegl-utils.h"
|
||||
#include "gimptilebackendtilemanager.h"
|
||||
|
||||
|
||||
/**
|
||||
@ -168,3 +169,17 @@ gimp_interpolation_to_gegl_filter (GimpInterpolationType interpolation)
|
||||
|
||||
return "nearest";
|
||||
}
|
||||
|
||||
GeglBuffer *
|
||||
gimp_tile_manager_get_gegl_buffer (TileManager *tm,
|
||||
gboolean write)
|
||||
{
|
||||
GeglTileBackend *backend;
|
||||
GeglBuffer *buffer;
|
||||
|
||||
backend = gimp_tile_backend_tile_manager_new (tm, write);
|
||||
buffer = gegl_buffer_new_for_backend (NULL, backend);
|
||||
g_object_unref (backend);
|
||||
|
||||
return buffer;
|
||||
}
|
||||
|
@ -30,5 +30,8 @@ TileManager * gimp_buffer_to_tiles (GeglBuffer *buffer);
|
||||
const gchar * gimp_layer_mode_to_gegl_operation (GimpLayerModeEffects mode) G_GNUC_CONST;
|
||||
const gchar * gimp_interpolation_to_gegl_filter (GimpInterpolationType interpolation) G_GNUC_CONST;
|
||||
|
||||
GeglBuffer * gimp_tile_manager_get_gegl_buffer (TileManager *tm,
|
||||
gboolean write);
|
||||
|
||||
|
||||
#endif /* __GIMP_GEGL_UTILS_H__ */
|
||||
|
@ -258,25 +258,3 @@ gimp_tile_backend_tile_manager_new (TileManager *tm,
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
GeglBuffer *
|
||||
gimp_tile_manager_get_gegl_buffer (TileManager *tm,
|
||||
gboolean write)
|
||||
{
|
||||
GeglTileBackend *backend;
|
||||
GeglBuffer *buffer;
|
||||
|
||||
backend = gimp_tile_backend_tile_manager_new (tm, write);
|
||||
buffer = gegl_buffer_new_for_backend (NULL, backend);
|
||||
g_object_unref (backend);
|
||||
|
||||
return buffer;
|
||||
}
|
||||
|
||||
GeglBuffer *
|
||||
gimp_drawable_get_gegl_buffer (GimpDrawable *drawable,
|
||||
gboolean write)
|
||||
{
|
||||
return gimp_tile_manager_get_gegl_buffer (gimp_drawable_get_tiles (drawable), write);
|
||||
}
|
||||
|
||||
|
@ -25,6 +25,7 @@
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
|
||||
#define GIMP_TYPE_TILE_BACKEND_TILE_MANAGER (gimp_tile_backend_tile_manager_get_type ())
|
||||
#define GIMP_TILE_BACKEND_TILE_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_TILE_BACKEND_TILE_MANAGER, GimpTileBackendTileManager))
|
||||
#define GIMP_TILE_BACKEND_TILE_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_TILE_BACKEND_TILE_MANAGER, GimpTileBackendTileManagerClass))
|
||||
@ -32,6 +33,7 @@ G_BEGIN_DECLS
|
||||
#define GIMP_IS_TILE_BACKEND_TILE_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_TILE_BACKEND_TILE_MANAGER))
|
||||
#define GIMP_TILE_BACKEND_TILE_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_TILE_BACKEND_TILE_MANAGER, GimpTileBackendTileManagerClass))
|
||||
|
||||
|
||||
typedef struct _GimpTileBackendTileManagerClass GimpTileBackendTileManagerClass;
|
||||
typedef struct _GimpTileBackendTileManagerPrivate GimpTileBackendTileManagerPrivate;
|
||||
|
||||
@ -47,15 +49,12 @@ struct _GimpTileBackendTileManagerClass
|
||||
GeglTileBackendClass parent_class;
|
||||
};
|
||||
|
||||
|
||||
GType gimp_tile_backend_tile_manager_get_type (void) G_GNUC_CONST;
|
||||
|
||||
GeglTileBackend * gimp_tile_backend_tile_manager_new (TileManager *tm,
|
||||
gboolean write);
|
||||
GeglTileBackend * gimp_tile_backend_tile_manager_new (TileManager *tm,
|
||||
gboolean write);
|
||||
|
||||
GeglBuffer * gimp_tile_manager_get_gegl_buffer (TileManager *tm,
|
||||
gboolean write);
|
||||
GeglBuffer * gimp_drawable_get_gegl_buffer (GimpDrawable *drawable,
|
||||
gboolean write);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
Reference in New Issue
Block a user