[librsvg/wip/otte: 15/39] defs: Remove rsvg_defs_add_resolver()
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg/wip/otte: 15/39] defs: Remove rsvg_defs_add_resolver()
- Date: Tue, 20 Oct 2015 12:35:01 +0000 (UTC)
commit 69ccf720d5d50d18fc7592c4cbd8715c60c77fa9
Author: Benjamin Otte <otte redhat com>
Date: Wed Oct 7 12:33:32 2015 +0200
defs: Remove rsvg_defs_add_resolver()
Now that all references are looked up lazily, we don't need to keep
track of things that are not resolved yet.
rsvg-base.c | 2 --
rsvg-defs.c | 48 ------------------------------------------------
rsvg-defs.h | 4 ----
3 files changed, 0 insertions(+), 54 deletions(-)
---
diff --git a/rsvg-base.c b/rsvg-base.c
index 86a2805..953e962 100644
--- a/rsvg-base.c
+++ b/rsvg-base.c
@@ -1213,7 +1213,6 @@ rsvg_handle_close_impl (RsvgHandle * handle, GError ** error)
xmlFreeDoc (xml_doc);
}
- rsvg_defs_resolve_all (handle->priv->defs);
handle->priv->finished = TRUE;
handle->priv->error = NULL;
@@ -1861,7 +1860,6 @@ rsvg_handle_read_stream_sync (RsvgHandle *handle,
xmlFreeDoc (doc);
- rsvg_defs_resolve_all (priv->defs);
priv->finished = TRUE;
res = TRUE;
diff --git a/rsvg-defs.c b/rsvg-defs.c
index 846b49b..280f87f 100644
--- a/rsvg-defs.c
+++ b/rsvg-defs.c
@@ -35,17 +35,9 @@ struct _RsvgDefs {
GHashTable *hash;
GPtrArray *unnamed;
GHashTable *externs;
- GSList *toresolve;
RsvgHandle *ctx;
};
-typedef struct _RsvgResolutionPending RsvgResolutionPending;
-
-struct _RsvgResolutionPending {
- RsvgNode **tochange;
- char *name;
-};
-
RsvgDefs *
rsvg_defs_new (RsvgHandle *handle)
{
@@ -55,7 +47,6 @@ rsvg_defs_new (RsvgHandle *handle)
result->externs =
g_hash_table_new_full (g_str_hash, g_str_equal, g_free, (GDestroyNotify) g_object_unref);
result->unnamed = g_ptr_array_new ();
- result->toresolve = NULL;
result->ctx = handle; /* no need to take a ref here */
return result;
@@ -153,20 +144,6 @@ rsvg_defs_register_memory (RsvgDefs * defs, RsvgNode * val)
g_ptr_array_add (defs->unnamed, val);
}
-static void
-rsvg_defs_free_toresolve (RsvgDefs *defs)
-{
- GSList *l;
-
- for (l = defs->toresolve; l ; l = l ->next) {
- RsvgResolutionPending *data = l->data;
-
- g_free (data->name);
- g_free (data);
- }
- g_slist_free (defs->toresolve);
-}
-
void
rsvg_defs_free (RsvgDefs * defs)
{
@@ -180,32 +157,7 @@ rsvg_defs_free (RsvgDefs * defs)
g_ptr_array_free (defs->unnamed, TRUE);
g_hash_table_destroy (defs->externs);
- rsvg_defs_free_toresolve (defs);
g_free (defs);
}
-void
-rsvg_defs_add_resolver (RsvgDefs * defs, RsvgNode ** tochange, const gchar * name)
-{
- RsvgResolutionPending *data;
- data = g_new (RsvgResolutionPending, 1);
- data->tochange = tochange;
- data->name = g_strdup (name);
- defs->toresolve = g_slist_prepend (defs->toresolve, data);
-}
-
-void
-rsvg_defs_resolve_all (RsvgDefs * defs)
-{
- GSList *l;
-
- for (l = defs->toresolve; l ; l = l ->next) {
- RsvgResolutionPending *data = l->data;
-
- *(data->tochange) = rsvg_defs_lookup (defs, data->name);
- }
-
- rsvg_defs_free_toresolve (defs);
- defs->toresolve = NULL;
-}
diff --git a/rsvg-defs.h b/rsvg-defs.h
index e7a2e9c..3d6802f 100644
--- a/rsvg-defs.h
+++ b/rsvg-defs.h
@@ -44,10 +44,6 @@ void rsvg_defs_set (RsvgDefs * defs, const char *name, RsvgNode * val);
G_GNUC_INTERNAL
void rsvg_defs_free (RsvgDefs * defs);
G_GNUC_INTERNAL
-void rsvg_defs_add_resolver (RsvgDefs * defs, RsvgNode ** tochange, const gchar * name);
-G_GNUC_INTERNAL
-void rsvg_defs_resolve_all (RsvgDefs * defs);
-G_GNUC_INTERNAL
void rsvg_defs_register_name (RsvgDefs * defs, const char *name, RsvgNode * val);
G_GNUC_INTERNAL
void rsvg_defs_register_memory (RsvgDefs * defs, RsvgNode * val);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]