[mutter/wip/cairo: 7/11] theme: Use cairo for drawing uncolorized IMAGEs



commit 0231200c69c2807ed982a7d8c4531ff82e9da1d8
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Fri Oct 28 22:02:18 2011 -0400

    theme: Use cairo for drawing uncolorized IMAGEs
    
    https://bugzilla.gnome.org/show_bug.cgi?id=662962

 src/ui/theme.c |   29 ++++++++++++++++++++---------
 1 files changed, 20 insertions(+), 9 deletions(-)
---
diff --git a/src/ui/theme.c b/src/ui/theme.c
index 2221894..11850f0 100644
--- a/src/ui/theme.c
+++ b/src/ui/theme.c
@@ -3773,21 +3773,32 @@ meta_draw_op_draw_with_env (const MetaDrawOp    *op,
             env->object_height = gdk_pixbuf_get_height (op->data.image.pixbuf);
           }
 
+        rx = parse_x_position_unchecked (op->data.image.x, env);
+        ry = parse_y_position_unchecked (op->data.image.y, env);
+
         rwidth = parse_size_unchecked (op->data.image.width, env);
         rheight = parse_size_unchecked (op->data.image.height, env);
-        
-        pixbuf = draw_op_as_pixbuf (op, style_gtk, info,
-                                    rwidth, rheight);
 
-        if (pixbuf)
+        if (op->data.image.pixbuf != NULL &&
+            op->data.image.colorize_spec == NULL)
+          {
+            draw_image (cr,
+                        op->data.image.pixbuf,
+                        op->data.image.fill_type,
+                        rx, ry, rwidth, rheight);
+          }
+        else if (op->data.image.colorize_spec != NULL)
           {
-            rx = parse_x_position_unchecked (op->data.image.x, env);
-            ry = parse_y_position_unchecked (op->data.image.y, env);
+            pixbuf = draw_op_as_pixbuf (op, style_gtk, info,
+                                        rwidth, rheight);
 
-            gdk_cairo_set_source_pixbuf (cr, pixbuf, rx, ry);
-            cairo_paint (cr);
+            if (pixbuf)
+              {
+                gdk_cairo_set_source_pixbuf (cr, pixbuf, rx, ry);
+                cairo_paint (cr);
 
-            g_object_unref (G_OBJECT (pixbuf));
+                g_object_unref (G_OBJECT (pixbuf));
+              }
           }
       }
       break;



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