summaryrefslogtreecommitdiff
path: root/gtk/gtkcssimageurl.c
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2013-02-02 00:23:31 +0100
committerBenjamin Otte <otte@redhat.com>2013-02-02 01:43:37 +0100
commite3cd958e369395c45d18ba1a3673dfb2d5247d95 (patch)
tree008234da224d1895197059ff18c6db04f3e6ad07 /gtk/gtkcssimageurl.c
parent18ca907c4cb37c234868ef13797f1a563fe01502 (diff)
downloadgtk+-e3cd958e369395c45d18ba1a3673dfb2d5247d95.tar.gz
cssimage: Return the loaded image from compute()
This way, we don't keep the indirection when actually rendering the image. https://bugzilla.gnome.org/show_bug.cgi?id=692934
Diffstat (limited to 'gtk/gtkcssimageurl.c')
-rw-r--r--gtk/gtkcssimageurl.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/gtk/gtkcssimageurl.c b/gtk/gtkcssimageurl.c
index 7462895723..2b51d3558d 100644
--- a/gtk/gtkcssimageurl.c
+++ b/gtk/gtkcssimageurl.c
@@ -61,6 +61,19 @@ gtk_css_image_url_draw (GtkCssImage *image,
_gtk_css_image_draw (url->loaded_image, cr, width, height);
}
+static GtkCssImage *
+gtk_css_image_url_compute (GtkCssImage *image,
+ guint property_id,
+ GtkStyleProviderPrivate *provider,
+ GtkCssComputedValues *values,
+ GtkCssComputedValues *parent_values,
+ GtkCssDependencies *dependencies)
+{
+ GtkCssImageUrl *url = GTK_CSS_IMAGE_URL (image);
+
+ return g_object_ref (url->loaded_image);
+}
+
static gboolean
gtk_css_image_url_parse (GtkCssImage *image,
GtkCssParser *parser)
@@ -140,6 +153,7 @@ _gtk_css_image_url_class_init (GtkCssImageUrlClass *klass)
image_class->get_width = gtk_css_image_url_get_width;
image_class->get_height = gtk_css_image_url_get_height;
image_class->get_aspect_ratio = gtk_css_image_url_get_aspect_ratio;
+ image_class->compute = gtk_css_image_url_compute;
image_class->draw = gtk_css_image_url_draw;
image_class->parse = gtk_css_image_url_parse;
image_class->print = gtk_css_image_url_print;