[gtk+] Avoid unnecessary indirect call



commit e71c5d3ab544466754bb1b85358186e8d7e7b9f9
Author: Alexander Larsson <alexl redhat com>
Date:   Thu Jul 23 21:52:32 2009 +0200

    Avoid unnecessary indirect call
    
    Call klass->draw_pixbuf directly inside gdk_window_draw_pixbuf
    instead of gdk_draw_pixbuf to avoid doing all checks twice.

 gdk/gdkwindow.c |   20 ++++++++++++--------
 1 files changed, 12 insertions(+), 8 deletions(-)
---
diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c
index ab2c396..374a69c 100644
--- a/gdk/gdkwindow.c
+++ b/gdk/gdkwindow.c
@@ -4225,6 +4225,7 @@ gdk_window_draw_pixbuf (GdkDrawable     *drawable,
 			gint             y_dither)
 {
   GdkWindowObject *private = (GdkWindowObject *)drawable;
+  GdkDrawableClass *klass;
 
   if (GDK_WINDOW_DESTROYED (drawable))
     return;
@@ -4235,16 +4236,19 @@ gdk_window_draw_pixbuf (GdkDrawable     *drawable,
     gc = _gdk_drawable_get_scratch_gc (drawable, FALSE);
 
   BEGIN_DRAW;
+
+  klass = GDK_DRAWABLE_GET_CLASS (impl);
+
   if (private->paint_stack)
-    gdk_draw_pixbuf (impl, gc, pixbuf, src_x, src_y,
-		     dest_x - x_offset, dest_y - y_offset,
-		     width, height,
-		     dither, x_dither - x_offset, y_dither - y_offset);
+    klass->draw_pixbuf (impl, gc, pixbuf, src_x, src_y,
+			dest_x - x_offset, dest_y - y_offset,
+			width, height,
+			dither, x_dither - x_offset, y_dither - y_offset);
   else
-    gdk_draw_pixbuf (impl, gc, pixbuf, src_x, src_y,
-		     dest_x - x_offset, dest_y - y_offset,
-		     width, height,
-		     dither, x_dither, y_dither);
+    klass->draw_pixbuf (impl, gc, pixbuf, src_x, src_y,
+			dest_x - x_offset, dest_y - y_offset,
+			width, height,
+			dither, x_dither, y_dither);
   END_DRAW;
 }
 



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