Commit 5ec574ba authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann

Reenabled update of the histogram while doing color corrections (bug

2007-10-26  Sven Neumann  <sven@gimp.org>

	Reenabled update of the histogram while doing color corrections
	(bug 490182):

	* app/core/gimpviewable.[ch]: added new methods preview_freeze()
	and preview_thaw().

	* app/core/gimpimagemap.c
	(gimp_image_map_new): freeze the drawable preview.
	(gimp_image_map_dispose): thaw the  drawable preview.
	(gimp_image_map_do): update the drawable, not the image.

	* app/tools/gimpimagemaptool.c (gimp_image_map_tool_response): no
	need to invalidate the drawable preview any longer.

svn path=/trunk/; revision=23956
parent 357c783b
2007-10-26 Sven Neumann <sven@gimp.org>
Reenabled update of the histogram while doing color corrections
(bug 490182):
* app/core/gimpviewable.[ch]: added new methods preview_freeze()
and preview_thaw().
* app/core/gimpimagemap.c
(gimp_image_map_new): freeze the drawable preview.
(gimp_image_map_dispose): thaw the drawable preview.
(gimp_image_map_do): update the drawable, not the image.
* app/tools/gimpimagemaptool.c (gimp_image_map_tool_response): no
need to invalidate the drawable preview any longer.
2007-10-26 Michael Natterer <mitch@gimp.org>
* app/xcf/xcf-load.c (xcf_load_image_props): never allocate
image->cmap smaller than GIMP_IMAGE_COLORMAP_SIZE.
Fixes bug #490048.
image->cmap smaller than GIMP_IMAGE_COLORMAP_SIZE. Fixes bug #490048.
2007-10-26 Sven Neumann <sven@gimp.org>
......
......@@ -33,6 +33,7 @@
#include "gimpimagemap.h"
#include "gimpmarshal.h"
#include "gimppickable.h"
#include "gimpviewable.h"
enum
......@@ -63,6 +64,7 @@ struct _GimpImageMap
static void gimp_image_map_pickable_iface_init (GimpPickableInterface *iface);
static void gimp_image_map_dispose (GObject *object);
static void gimp_image_map_finalize (GObject *object);
static GimpImage * gimp_image_map_get_image (GimpPickable *pickable);
......@@ -100,6 +102,7 @@ gimp_image_map_class_init (GimpImageMapClass *klass)
gimp_marshal_VOID__VOID,
G_TYPE_NONE, 0);
object_class->dispose = gimp_image_map_dispose;
object_class->finalize = gimp_image_map_finalize;
}
......@@ -127,6 +130,17 @@ gimp_image_map_init (GimpImageMap *image_map)
image_map->idle_id = 0;
}
static void
gimp_image_map_dispose (GObject *object)
{
GimpImageMap *image_map = GIMP_IMAGE_MAP (object);
if (image_map->drawable)
gimp_viewable_preview_thaw (GIMP_VIEWABLE (image_map->drawable));
G_OBJECT_CLASS (parent_class)->dispose (object);
}
static void
gimp_image_map_finalize (GObject *object)
{
......@@ -153,6 +167,12 @@ gimp_image_map_finalize (GObject *object)
image_map->PRI = NULL;
}
if (image_map->drawable)
{
g_object_unref (image_map->drawable);
image_map->drawable = NULL;
}
G_OBJECT_CLASS (parent_class)->finalize (object);
}
......@@ -243,9 +263,11 @@ gimp_image_map_new (GimpDrawable *drawable,
image_map = g_object_new (GIMP_TYPE_IMAGE_MAP, NULL);
image_map->drawable = drawable;
image_map->drawable = g_object_ref (drawable);
image_map->undo_desc = g_strdup (undo_desc);
gimp_viewable_preview_freeze (GIMP_VIEWABLE (drawable));
return image_map;
}
......@@ -474,7 +496,6 @@ static gboolean
gimp_image_map_do (GimpImageMap *image_map)
{
GimpImage *image;
gint off_x, off_y;
gint i;
if (! gimp_item_is_attached (GIMP_ITEM (image_map->drawable)))
......@@ -486,8 +507,6 @@ gimp_image_map_do (GimpImageMap *image_map)
image = gimp_item_get_image (GIMP_ITEM (image_map->drawable));
gimp_item_offsets (GIMP_ITEM (image_map->drawable), &off_x, &off_y);
/* Process up to 16 tiles in one go. This reduces the overhead
* caused by updating the display while the imagemap is being
* applied and gives us a tiny speedup.
......@@ -525,11 +544,7 @@ gimp_image_map_do (GimpImageMap *image_map)
NULL,
x, y);
/* Update the image -- It is important to call gimp_image_update()
* instead of gimp_drawable_update() because we don't want the
* drawable preview to be constantly invalidated
*/
gimp_image_update (image, x + off_x, y + off_y, w, h);
gimp_drawable_update (image_map->drawable, x, y, w, h);
image_map->PRI = pixel_regions_process (image_map->PRI);
......
......@@ -163,7 +163,8 @@ gimp_viewable_class_init (GimpViewableClass *klass)
static void
gimp_viewable_init (GimpViewable *viewable)
{
viewable->stock_id = NULL;
viewable->stock_id = NULL;
viewable->freeze_count = 0;
}
static void
......@@ -398,7 +399,8 @@ gimp_viewable_invalidate_preview (GimpViewable *viewable)
{
g_return_if_fail (GIMP_IS_VIEWABLE (viewable));
g_signal_emit (viewable, viewable_signals[INVALIDATE_PREVIEW], 0);
if (viewable->freeze_count == 0)
g_signal_emit (viewable, viewable_signals[INVALIDATE_PREVIEW], 0);
}
/**
......@@ -1042,3 +1044,23 @@ gimp_viewable_set_stock_id (GimpViewable *viewable,
g_object_notify (G_OBJECT (viewable), "stock-id");
}
void
gimp_viewable_preview_freeze (GimpViewable *viewable)
{
g_return_if_fail (GIMP_IS_VIEWABLE (viewable));
viewable->freeze_count++;
}
void
gimp_viewable_preview_thaw (GimpViewable *viewable)
{
g_return_if_fail (GIMP_IS_VIEWABLE (viewable));
g_return_if_fail (viewable->freeze_count > 0);
viewable->freeze_count--;
if (viewable->freeze_count == 0)
gimp_viewable_invalidate_preview (viewable);
}
......@@ -52,6 +52,7 @@ struct _GimpViewable
/*< private >*/
gchar *stock_id;
gint freeze_count;
};
struct _GimpViewableClass
......@@ -169,5 +170,8 @@ const gchar * gimp_viewable_get_stock_id (GimpViewable *viewable);
void gimp_viewable_set_stock_id (GimpViewable *viewable,
const gchar *stock_id);
void gimp_viewable_preview_freeze (GimpViewable *viewable);
void gimp_viewable_preview_thaw (GimpViewable *viewable);
#endif /* __GIMP_VIEWABLE_H__ */
......@@ -487,7 +487,6 @@ gimp_image_map_tool_response (GtkWidget *widget,
gimp_tool_control_set_preserve (tool->control, FALSE);
gimp_viewable_invalidate_preview (GIMP_VIEWABLE (image_map_tool->drawable));
gimp_image_flush (tool->display->image);
}
......@@ -508,7 +507,6 @@ gimp_image_map_tool_response (GtkWidget *widget,
gimp_tool_control_set_preserve (tool->control, FALSE);
gimp_viewable_invalidate_preview (GIMP_VIEWABLE (image_map_tool->drawable));
gimp_image_flush (tool->display->image);
}
......
2007-10-26 Sven Neumann <sven@gimp.org>
* app/app-sections.txt: updated.
2007-10-25 Sven Neumann <sven@gimp.org>
* app/Makefile.am: pass options to gtkdoc-fixref.
2007-10-22 Sven Neumann <sven@gimp.org>
* devel-docs/app/app-sections.txt: updated.
* app/app-sections.txt: updated.
2007-10-18 Raphaël Quinet <raphael@gimp.org>
......
......@@ -1931,6 +1931,8 @@ gimp_viewable_get_dummy_pixbuf
gimp_viewable_get_description
gimp_viewable_get_stock_id
gimp_viewable_set_stock_id
gimp_viewable_preview_freeze
gimp_viewable_preview_thaw
<SUBSECTION Standard>
GimpViewableClass
GIMP_VIEWABLE
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment