wxBitmap does not need to use gdk_wx_draw_bitmap
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@40596 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
13785a4b8f
commit
9be3f7558d
@ -24,16 +24,6 @@
|
|||||||
|
|
||||||
#include <gtk/gtk.h>
|
#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
|
// data
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
@ -197,9 +187,8 @@ bool wxMask::Create( const wxBitmap& bitmap )
|
|||||||
if (!m_bitmap) return false;
|
if (!m_bitmap) return false;
|
||||||
|
|
||||||
GdkGC *gc = gdk_gc_new( m_bitmap );
|
GdkGC *gc = gdk_gc_new( m_bitmap );
|
||||||
|
gdk_gc_set_function(gc, GDK_COPY_INVERT);
|
||||||
gdk_wx_draw_bitmap( m_bitmap, gc, bitmap.GetPixmap(), 0, 0, 0, 0, bitmap.GetWidth(), bitmap.GetHeight() );
|
gdk_draw_drawable(m_bitmap, gc, bitmap.GetPixmap(), 0, 0, 0, 0, bitmap.GetWidth(), bitmap.GetHeight());
|
||||||
|
|
||||||
g_object_unref (gc);
|
g_object_unref (gc);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@ -919,23 +908,9 @@ wxBitmap wxBitmap::GetSubBitmap( const wxRect& rect) const
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
ret = wxBitmap(rect.width, rect.height, M_BMPDATA->m_bpp);
|
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 );
|
||||||
GdkGC *gc = gdk_gc_new( ret.GetPixmap() );
|
g_object_unref (gc);
|
||||||
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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GetMask())
|
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 );
|
mask->m_bitmap = gdk_pixmap_new( wxGetRootWindow()->window, rect.width, rect.height, 1 );
|
||||||
|
|
||||||
GdkGC *gc = gdk_gc_new( mask->m_bitmap );
|
GdkGC *gc = gdk_gc_new( mask->m_bitmap );
|
||||||
GdkColor col;
|
gdk_draw_drawable(mask->m_bitmap, gc, M_BMPDATA->m_mask->m_bitmap, rect.x, rect.y, 0, 0, rect.width, rect.height);
|
||||||
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 );
|
|
||||||
g_object_unref (gc);
|
g_object_unref (gc);
|
||||||
|
|
||||||
ret.SetMask( mask );
|
ret.SetMask( mask );
|
||||||
|
@ -82,6 +82,7 @@ static inline double DegToRad(double deg) { return (deg * M_PI) / 180.0; }
|
|||||||
|
|
||||||
#include "gdk/gdkprivate.h"
|
#include "gdk/gdkprivate.h"
|
||||||
|
|
||||||
|
static
|
||||||
void gdk_wx_draw_bitmap(GdkDrawable *drawable,
|
void gdk_wx_draw_bitmap(GdkDrawable *drawable,
|
||||||
GdkGC *gc,
|
GdkGC *gc,
|
||||||
GdkDrawable *src,
|
GdkDrawable *src,
|
||||||
|
Loading…
Reference in New Issue
Block a user