[gtk+/client-side-windows: 85/284] Make sure we handle clipping in gdk_window_draw_pixbuf if gc == NULL



commit e918b640887f7891cb097ed22f83fe790887a28c
Author: Alexander Larsson <alex localhost localdomain>
Date:   Fri Jan 16 15:45:18 2009 +0100

    Make sure we handle clipping in gdk_window_draw_pixbuf if gc == NULL
---
 gdk/gdkwindow.c |   32 +++++++-------------------------
 1 files changed, 7 insertions(+), 25 deletions(-)

diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c
index dd99982..ef89881 100644
--- a/gdk/gdkwindow.c
+++ b/gdk/gdkwindow.c
@@ -3756,8 +3756,13 @@ gdk_window_draw_pixbuf (GdkDrawable     *drawable,
 
   if (GDK_WINDOW_DESTROYED (drawable))
     return;
-  
-  if (gc)
+
+  /* If no gc => no user clipping, but we need clipping
+     for window emulation, so use a scratch gc */
+  if (!gc)
+    gc = _gdk_drawable_get_scratch_gc (drawable, FALSE);
+
+  /* Need block to make OFFSET_GC macro to work */
     {
       OFFSET_GC (gc);
   
@@ -3783,29 +3788,6 @@ gdk_window_draw_pixbuf (GdkDrawable     *drawable,
       
       RESTORE_GC (gc);
     }
-  else
-    {
-      gint x_offset, y_offset;
-      gdk_window_get_offsets (drawable, &x_offset, &y_offset);
-      
-      if (private->paint_stack)
-	{
-	  GdkWindowPaint *paint = private->paint_stack->data;
-	  /* TODO: Do paint clipping here... */
-	  gdk_draw_pixbuf (paint->pixmap, 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
-	{
-	  /* TODO: No GC passed in, but still want clipping here... */
-	  gdk_draw_pixbuf (private->impl, gc, pixbuf, src_x, src_y,
-			   dest_x - x_offset, dest_y - y_offset,
-			   width, height,
-			   dither, x_dither, y_dither);
-	}
-    }
 }
 
 static void



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