]> git.saurik.com Git - wxWidgets.git/commitdiff
wxBitmap does not need to use gdk_wx_draw_bitmap
authorPaul Cornett <paulcor@bullseye.com>
Sun, 13 Aug 2006 05:56:27 +0000 (05:56 +0000)
committerPaul Cornett <paulcor@bullseye.com>
Sun, 13 Aug 2006 05:56:27 +0000 (05:56 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@40596 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/gtk/bitmap.cpp
src/gtk/dcclient.cpp

index 2476c1b9e7d97716811e0d48a392d774dc90d7c3..790e34f3d052928852d712b0601d93dc1f6f6d02 100644 (file)
 
 #include <gtk/gtk.h>
 
-extern void gdk_wx_draw_bitmap     (GdkDrawable  *drawable,
-                          GdkGC               *gc,
-                          GdkDrawable  *src,
-                          gint                xsrc,
-                          gint                ysrc,
-                          gint                xdest,
-                          gint                ydest,
-                          gint                width,
-                          gint                height);
-
 //-----------------------------------------------------------------------------
 // data
 //-----------------------------------------------------------------------------
@@ -197,9 +187,8 @@ bool wxMask::Create( const wxBitmap& bitmap )
     if (!m_bitmap) return false;
 
     GdkGC *gc = gdk_gc_new( m_bitmap );
-
-    gdk_wx_draw_bitmap( m_bitmap, gc, bitmap.GetPixmap(), 0, 0, 0, 0, bitmap.GetWidth(), bitmap.GetHeight() );
-
+    gdk_gc_set_function(gc, GDK_COPY_INVERT);
+    gdk_draw_drawable(m_bitmap, gc, bitmap.GetPixmap(), 0, 0, 0, 0, bitmap.GetWidth(), bitmap.GetHeight());
     g_object_unref (gc);
 
     return true;
@@ -919,23 +908,9 @@ wxBitmap wxBitmap::GetSubBitmap( const wxRect& rect) const
     else
     {
         ret = wxBitmap(rect.width, rect.height, M_BMPDATA->m_bpp);
-        if (M_BMPDATA->m_bpp != 1)
-        {
-            GdkGC *gc = gdk_gc_new( ret.GetPixmap() );
-            gdk_draw_drawable( ret.GetPixmap(), gc, GetPixmap(), rect.x, rect.y, 0, 0, rect.width, rect.height );
-            g_object_unref (gc);
-        }
-        else
-        {
-            GdkGC *gc = gdk_gc_new( ret.GetPixmap() );
-            GdkColor col;
-            col.pixel = 0xFFFFFF;
-            gdk_gc_set_foreground( gc, &col );
-            col.pixel = 0;
-            gdk_gc_set_background( gc, &col );
-            gdk_wx_draw_bitmap( ret.GetPixmap(), gc, GetPixmap(), rect.x, rect.y, 0, 0, rect.width, rect.height );
-            g_object_unref (gc);
-        }
+        GdkGC *gc = gdk_gc_new( ret.GetPixmap() );
+        gdk_draw_drawable( ret.GetPixmap(), gc, GetPixmap(), rect.x, rect.y, 0, 0, rect.width, rect.height );
+        g_object_unref (gc);
     }
 
     if (GetMask())
@@ -944,12 +919,7 @@ wxBitmap wxBitmap::GetSubBitmap( const wxRect& rect) const
         mask->m_bitmap = gdk_pixmap_new( wxGetRootWindow()->window, rect.width, rect.height, 1 );
 
         GdkGC *gc = gdk_gc_new( mask->m_bitmap );
-        GdkColor col;
-        col.pixel = 0xFFFFFF;
-        gdk_gc_set_foreground( gc, &col );
-        col.pixel = 0;
-        gdk_gc_set_background( gc, &col );
-        gdk_wx_draw_bitmap( mask->m_bitmap, gc, M_BMPDATA->m_mask->m_bitmap, rect.x, rect.y, 0, 0, rect.width, rect.height );
+        gdk_draw_drawable(mask->m_bitmap, gc, M_BMPDATA->m_mask->m_bitmap, rect.x, rect.y, 0, 0, rect.width, rect.height);
         g_object_unref (gc);
 
         ret.SetMask( mask );
index e0898d91d0ae166ee6d2b87fdfea2adbaeca3e5d..4fff123998b74978b5a34708c134b21c1a12109b 100644 (file)
@@ -82,6 +82,7 @@ static inline double DegToRad(double deg) { return (deg * M_PI) / 180.0; }
 
 #include "gdk/gdkprivate.h"
 
+static
 void gdk_wx_draw_bitmap(GdkDrawable  *drawable,
                         GdkGC        *gc,
                         GdkDrawable  *src,