app: remove GimpImage's cached preview

because GimpViewable already implements exactly the same.
This commit is contained in:
Michael Natterer
2012-06-25 00:23:07 +02:00
parent 38bec7d924
commit daad966b8f
4 changed files with 0 additions and 62 deletions

View File

@ -94,34 +94,6 @@ gimp_image_get_popup_size (GimpViewable *viewable,
return FALSE;
}
GimpTempBuf *
gimp_image_get_preview (GimpViewable *viewable,
GimpContext *context,
gint width,
gint height)
{
GimpImagePrivate *private = GIMP_IMAGE_GET_PRIVATE (viewable);
if (private->preview &&
gimp_temp_buf_get_width (private->preview) == width &&
gimp_temp_buf_get_height (private->preview) == height)
{
/* The easy way */
return private->preview;
}
else
{
/* The hard way */
if (private->preview)
gimp_temp_buf_unref (private->preview);
private->preview = gimp_image_get_new_preview (viewable, context,
width, height);
return private->preview;
}
}
GimpTempBuf *
gimp_image_get_new_preview (GimpViewable *viewable,
GimpContext *context,

View File

@ -35,10 +35,6 @@ gboolean gimp_image_get_popup_size (GimpViewable *viewable,
gboolean dot_for_dot,
gint *popup_width,
gint *popup_height);
GimpTempBuf * gimp_image_get_preview (GimpViewable *viewable,
GimpContext *context,
gint width,
gint height);
GimpTempBuf * gimp_image_get_new_preview (GimpViewable *viewable,
GimpContext *context,
gint width,

View File

@ -100,9 +100,6 @@ struct _GimpImagePrivate
gint group_count; /* nested undo groups */
GimpUndoType pushing_undo_group; /* undo group status flag */
/* Preview */
GimpTempBuf *preview; /* the projection preview */
/* Signal emmision accumulator */
GimpImageFlushAccumulator flush_accum;
};

View File

@ -157,7 +157,6 @@ static gint64 gimp_image_get_memsize (GimpObject *object,
static gboolean gimp_image_get_size (GimpViewable *viewable,
gint *width,
gint *height);
static void gimp_image_invalidate_preview (GimpViewable *viewable);
static void gimp_image_size_changed (GimpViewable *viewable);
static gchar * gimp_image_get_description (GimpViewable *viewable,
gchar **tooltip);
@ -522,11 +521,9 @@ gimp_image_class_init (GimpImageClass *klass)
viewable_class->default_stock_id = "gimp-image";
viewable_class->get_size = gimp_image_get_size;
viewable_class->invalidate_preview = gimp_image_invalidate_preview;
viewable_class->size_changed = gimp_image_size_changed;
viewable_class->get_preview_size = gimp_image_get_preview_size;
viewable_class->get_popup_size = gimp_image_get_popup_size;
viewable_class->get_preview = gimp_image_get_preview;
viewable_class->get_new_preview = gimp_image_get_new_preview;
viewable_class->get_description = gimp_image_get_description;
@ -728,8 +725,6 @@ gimp_image_init (GimpImage *image)
private->group_count = 0;
private->pushing_undo_group = GIMP_UNDO_GROUP_NONE;
private->preview = NULL;
private->flush_accum.alpha_changed = FALSE;
private->flush_accum.mask_changed = FALSE;
private->flush_accum.floating_selection_changed = FALSE;
@ -947,12 +942,6 @@ gimp_image_finalize (GObject *object)
private->selection_mask = NULL;
}
if (private->preview)
{
gimp_temp_buf_unref (private->preview);
private->preview = NULL;
}
if (private->parasites)
{
g_object_unref (private->parasites);
@ -1074,8 +1063,6 @@ gimp_image_get_memsize (GimpObject *object,
memsize += gimp_object_get_memsize (GIMP_OBJECT (private->redo_stack),
gui_size);
*gui_size += gimp_temp_buf_get_memsize (private->preview);
return memsize + GIMP_OBJECT_CLASS (parent_class)->get_memsize (object,
gui_size);
}
@ -1093,20 +1080,6 @@ gimp_image_get_size (GimpViewable *viewable,
return TRUE;
}
static void
gimp_image_invalidate_preview (GimpViewable *viewable)
{
GimpImagePrivate *private = GIMP_IMAGE_GET_PRIVATE (viewable);
GIMP_VIEWABLE_CLASS (parent_class)->invalidate_preview (viewable);
if (private->preview)
{
gimp_temp_buf_unref (private->preview);
private->preview = NULL;
}
}
static void
gimp_image_size_changed (GimpViewable *viewable)
{