summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormonsta <[email protected]>2015-12-03 16:14:43 +0300
committermonsta <[email protected]>2015-12-03 16:14:43 +0300
commitaddaafa92d7ca4895b5cbe9adc497d9ec1109f7d (patch)
tree129b0363ded12a8a05ec763ce9d8d66b1d3f90fc /src
parent10d10f5ee8db39f441a2fae623ccb7d7898f9f0a (diff)
downloadeom-addaafa92d7ca4895b5cbe9adc497d9ec1109f7d.tar.bz2
eom-addaafa92d7ca4895b5cbe9adc497d9ec1109f7d.tar.xz
remove ancient workaround for non-threadsafe pixbuf loaders
from https://git.gnome.org/browse/eog/commit/?id=a9c9d81405e31443ab51713f6a0712f9bb10e11b
Diffstat (limited to 'src')
-rw-r--r--src/eom-image-private.h1
-rw-r--r--src/eom-image.c71
2 files changed, 6 insertions, 66 deletions
diff --git a/src/eom-image-private.h b/src/eom-image-private.h
index b0ba0f0..3a031b6 100644
--- a/src/eom-image-private.h
+++ b/src/eom-image-private.h
@@ -51,7 +51,6 @@ struct _EomImagePrivate {
goffset bytes;
gchar *file_type;
- gboolean threadsafe_format;
/* Holds EXIF raw data */
guint exif_chunk_len;
diff --git a/src/eom-image.c b/src/eom-image.c
index 3cd8e34..45e03c8 100644
--- a/src/eom-image.c
+++ b/src/eom-image.c
@@ -483,40 +483,6 @@ eom_image_emit_size_prepared (EomImage *img)
g_object_ref (img), g_object_unref);
}
-static gboolean
-check_loader_threadsafety (GdkPixbufLoader *loader, gboolean *result)
-{
- GdkPixbufFormat *format;
- gboolean ret_val = FALSE;
-
- format = gdk_pixbuf_loader_get_format (loader);
- if (format) {
- ret_val = TRUE;
- if (result)
- /* FIXME: We should not be accessing this struct internals
- * directly. Keep track of bug #469209 to fix that. */
- *result = format->flags & GDK_PIXBUF_FORMAT_THREADSAFE;
- }
-
- return ret_val;
-}
-
-static void
-eom_image_pre_size_prepared (GdkPixbufLoader *loader,
- gint width,
- gint height,
- gpointer data)
-{
- EomImage *img;
-
- eom_debug (DEBUG_IMAGE_LOAD);
-
- g_return_if_fail (EOM_IS_IMAGE (data));
-
- img = EOM_IMAGE (data);
- check_loader_threadsafety (loader, &img->priv->threadsafe_format);
-}
-
static void
eom_image_size_prepared (GdkPixbufLoader *loader,
gint width,
@@ -539,9 +505,7 @@ eom_image_size_prepared (GdkPixbufLoader *loader,
g_mutex_unlock (&img->priv->status_mutex);
#ifdef HAVE_EXIF
- if (img->priv->threadsafe_format && (!img->priv->autorotate || img->priv->exif))
-#else
- if (img->priv->threadsafe_format)
+ if (!img->priv->autorotate || img->priv->exif)
#endif
eom_image_emit_size_prepared (img);
}
@@ -909,8 +873,6 @@ eom_image_real_load (EomImage *img,
priv->file_type = NULL;
}
- priv->threadsafe_format = FALSE;
-
eom_image_get_file_info (img, &priv->bytes, &mime_type, error);
if (error && *error) {
@@ -953,8 +915,6 @@ eom_image_real_load (EomImage *img,
buffer = g_new0 (guchar, EOM_IMAGE_READ_BUFFER_SIZE);
if (read_image_data || read_only_dimension) {
- gboolean checked_threadsafety = FALSE;
-
#ifdef HAVE_RSVG
if (priv->svg != NULL) {
g_object_unref (priv->svg);
@@ -977,21 +937,8 @@ eom_image_real_load (EomImage *img,
*error = NULL;
loader = gdk_pixbuf_loader_new ();
- } else {
- /* The mimetype-based loader should know the
- * format here already. */
- checked_threadsafety = check_loader_threadsafety (loader, &priv->threadsafe_format);
}
- /* This is used to detect non-threadsafe loaders and disable
- * any possible asyncronous task that could bring deadlocks
- * to image loading process. */
- if (!checked_threadsafety)
- g_signal_connect (loader,
- "size-prepared",
- G_CALLBACK (eom_image_pre_size_prepared),
- img);
-
g_signal_connect_object (G_OBJECT (loader),
"size-prepared",
G_CALLBACK (eom_image_size_prepared),
@@ -1049,16 +996,15 @@ eom_image_real_load (EomImage *img,
if (data2read == EOM_IMAGE_DATA_EXIF) {
g_set_error (error,
EOM_IMAGE_ERROR,
- EOM_IMAGE_ERROR_GENERIC,
- _("EXIF not supported for this file format."));
+ EOM_IMAGE_ERROR_GENERIC,
+ _("EXIF not supported for this file format."));
break;
}
- if (priv->threadsafe_format)
- eom_image_emit_size_prepared (img);
+ eom_image_emit_size_prepared (img);
- priv->metadata_status = EOM_IMAGE_METADATA_NOT_AVAILABLE;
- }
+ priv->metadata_status = EOM_IMAGE_METADATA_NOT_AVAILABLE;
+ }
first_run = FALSE;
}
@@ -1152,11 +1098,6 @@ eom_image_real_load (EomImage *img,
}
priv->file_is_changed = FALSE;
-
- /* If it's non-threadsafe loader, then trigger window
- * showing in the end of the process. */
- if (!priv->threadsafe_format)
- eom_image_emit_size_prepared (img);
} else {
/* Some loaders don't report errors correctly.
* Error will be set below. */