[gtk+/icon-shadow: 2/11] shadow: add _gtk_icon_shadow_paint_surface()



commit 27c35c50f979a69c340a7de63c15b35aa4f5bc3f
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Fri May 20 23:51:16 2011 -0400

    shadow: add _gtk_icon_shadow_paint_surface()

 gtk/gtkshadow.c        |   23 +++++++++++++++++++++++
 gtk/gtkshadowprivate.h |    9 +++++++++
 2 files changed, 32 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkshadow.c b/gtk/gtkshadow.c
index f1f58c8..2a92db6 100644
--- a/gtk/gtkshadow.c
+++ b/gtk/gtkshadow.c
@@ -284,3 +284,26 @@ _gtk_text_shadow_paint_layout (GtkShadow       *shadow,
   }
 }
 
+void
+_gtk_icon_shadow_paint_surface (GtkShadow *shadow,
+                                cairo_t *cr,
+                                gdouble x,
+                                gdouble y,
+                                gdouble width,
+                                gdouble height,
+                                cairo_surface_t *surface)
+{
+  GList *l;
+  GtkShadowElement *element;
+
+  for (l = g_list_last (shadow->elements); l != NULL; l = l->prev)
+    {
+      element = l->data;
+
+      cairo_save (cr);
+      gdk_cairo_set_source_rgba (cr, &element->color);
+      cairo_mask_surface (cr, surface, x + element->hoffset, y + element->voffset);
+
+      cairo_restore (cr);
+    }
+}
diff --git a/gtk/gtkshadowprivate.h b/gtk/gtkshadowprivate.h
index 46ef0ff..f041d64 100644
--- a/gtk/gtkshadowprivate.h
+++ b/gtk/gtkshadowprivate.h
@@ -57,6 +57,15 @@ void       _gtk_text_shadow_paint_layout (GtkShadow       *shadow,
                                           cairo_t         *cr,
                                           PangoLayout     *layout);
 
+void
+_gtk_icon_shadow_paint_surface (GtkShadow *shadow,
+                                cairo_t *cr,
+                                gdouble x,
+                                gdouble y,
+                                gdouble width,
+                                gdouble height,
+                                cairo_surface_t *surface);
+
 G_END_DECLS
 
 #endif /* __GTK_SHADOW_H__ */



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]