remove redundant GdkBitmap representation from wxBitmap

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@39796 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Paul Cornett
2006-06-19 18:30:13 +00:00
parent 0006b9a540
commit b85229d15b
5 changed files with 32 additions and 75 deletions
-2
View File
@@ -113,11 +113,9 @@ public:
void SetWidth( int width );
void SetDepth( int depth );
void SetPixmap( GdkPixmap *pixmap );
void SetBitmap( GdkBitmap *bitmap );
void SetPixbuf(GdkPixbuf *pixbuf);
GdkPixmap *GetPixmap() const;
GdkBitmap *GetBitmap() const;
bool HasPixmap() const;
bool HasPixbuf() const;
GdkPixbuf *GetPixbuf() const;
+18 -52
View File
File diff suppressed because it is too large Load Diff
+7 -7
View File
@@ -1069,7 +1069,7 @@ void wxWindowDC::DoDrawBitmap( const wxBitmap &bitmap,
wxCHECK_RET( bitmap.Ok(), wxT("invalid bitmap") );
bool is_mono = (bitmap.GetBitmap() != NULL);
bool is_mono = bitmap.GetDepth() == 1;
// scale/translate size and position
int xx = XLOG2DEV(x);
@@ -1162,7 +1162,7 @@ void wxWindowDC::DoDrawBitmap( const wxBitmap &bitmap,
GdkGC *gc = gdk_gc_new( bitmap2 );
gdk_gc_set_foreground( gc, m_textForegroundColour.GetColor() );
gdk_gc_set_background( gc, m_textBackgroundColour.GetColor() );
gdk_wx_draw_bitmap( bitmap2, gc, use_bitmap.GetBitmap(), 0, 0, 0, 0, -1, -1 );
gdk_wx_draw_bitmap( bitmap2, gc, use_bitmap.GetPixmap(), 0, 0, 0, 0, -1, -1 );
gdk_draw_drawable( m_window, m_textGC, bitmap2, 0, 0, xx, yy, -1, -1 );
@@ -1416,7 +1416,7 @@ bool wxWindowDC::DoBlit( wxCoord xdest, wxCoord ydest,
GdkGC *gc = gdk_gc_new( bitmap );
gdk_gc_set_foreground( gc, m_textForegroundColour.GetColor() );
gdk_gc_set_background( gc, m_textBackgroundColour.GetColor() );
gdk_wx_draw_bitmap( bitmap, gc, use_bitmap.GetBitmap(), 0, 0, 0, 0, -1, -1 );
gdk_wx_draw_bitmap( bitmap, gc, use_bitmap.GetPixmap(), 0, 0, 0, 0, -1, -1 );
gdk_draw_drawable( m_window, m_textGC, bitmap, xsrc, ysrc, cx, cy, cw, ch );
@@ -2009,7 +2009,7 @@ void wxWindowDC::SetBrush( const wxBrush &brush )
if ((m_brush.GetStyle() == wxSTIPPLE) && (m_brush.GetStipple()->Ok()))
{
if (m_brush.GetStipple()->GetPixmap())
if (m_brush.GetStipple()->GetDepth() != 1)
{
gdk_gc_set_fill( m_brushGC, GDK_TILED );
gdk_gc_set_tile( m_brushGC, m_brush.GetStipple()->GetPixmap() );
@@ -2017,7 +2017,7 @@ void wxWindowDC::SetBrush( const wxBrush &brush )
else
{
gdk_gc_set_fill( m_brushGC, GDK_STIPPLED );
gdk_gc_set_stipple( m_brushGC, m_brush.GetStipple()->GetBitmap() );
gdk_gc_set_stipple( m_brushGC, m_brush.GetStipple()->GetPixmap() );
}
}
@@ -2060,7 +2060,7 @@ void wxWindowDC::SetBackground( const wxBrush &brush )
if ((m_backgroundBrush.GetStyle() == wxSTIPPLE) && (m_backgroundBrush.GetStipple()->Ok()))
{
if (m_backgroundBrush.GetStipple()->GetPixmap())
if (m_backgroundBrush.GetStipple()->GetDepth() != 1)
{
gdk_gc_set_fill( m_bgGC, GDK_TILED );
gdk_gc_set_tile( m_bgGC, m_backgroundBrush.GetStipple()->GetPixmap() );
@@ -2068,7 +2068,7 @@ void wxWindowDC::SetBackground( const wxBrush &brush )
else
{
gdk_gc_set_fill( m_bgGC, GDK_STIPPLED );
gdk_gc_set_stipple( m_bgGC, m_backgroundBrush.GetStipple()->GetBitmap() );
gdk_gc_set_stipple( m_bgGC, m_backgroundBrush.GetStipple()->GetPixmap() );
}
}
+6 -13
View File
@@ -59,14 +59,7 @@ void wxMemoryDC::SelectObject( const wxBitmap& bitmap )
m_selected = bitmap;
if (m_selected.Ok())
{
if (m_selected.GetPixmap())
{
m_window = m_selected.GetPixmap();
}
else
{
m_window = m_selected.GetBitmap();
}
m_window = m_selected.GetPixmap();
m_selected.PurgeOtherRepresentations(wxBitmap::Pixmap);
@@ -85,7 +78,7 @@ void wxMemoryDC::SetPen( const wxPen& penOrig )
{
wxPen pen( penOrig );
if ( m_selected.Ok() &&
m_selected.GetBitmap() &&
m_selected.GetDepth() == 1 &&
(pen != *wxTRANSPARENT_PEN) )
{
pen.SetColour( pen.GetColour() == *wxWHITE ? *wxBLACK : *wxWHITE );
@@ -98,7 +91,7 @@ void wxMemoryDC::SetBrush( const wxBrush& brushOrig )
{
wxBrush brush( brushOrig );
if ( m_selected.Ok() &&
m_selected.GetBitmap() &&
m_selected.GetDepth() == 1 &&
(brush != *wxTRANSPARENT_BRUSH) )
{
brush.SetColour( brush.GetColour() == *wxWHITE ? *wxBLACK : *wxWHITE);
@@ -112,7 +105,7 @@ void wxMemoryDC::SetBackground( const wxBrush& brushOrig )
wxBrush brush(brushOrig);
if ( m_selected.Ok() &&
m_selected.GetBitmap() &&
m_selected.GetDepth() == 1 &&
(brush != *wxTRANSPARENT_BRUSH) )
{
brush.SetColour( brush.GetColour() == *wxWHITE ? *wxBLACK : *wxWHITE );
@@ -123,7 +116,7 @@ void wxMemoryDC::SetBackground( const wxBrush& brushOrig )
void wxMemoryDC::SetTextForeground( const wxColour& col )
{
if ( m_selected.Ok() && m_selected.GetBitmap() )
if ( m_selected.Ok() && m_selected.GetDepth() == 1 )
{
wxWindowDC::SetTextForeground( col == *wxWHITE ? *wxBLACK : *wxWHITE);
}
@@ -135,7 +128,7 @@ void wxMemoryDC::SetTextForeground( const wxColour& col )
void wxMemoryDC::SetTextBackground( const wxColour &col )
{
if (m_selected.Ok() && m_selected.GetBitmap())
if (m_selected.Ok() && m_selected.GetDepth() == 1)
{
wxWindowDC::SetTextBackground( col == *wxWHITE ? *wxBLACK : *wxWHITE );
}
+1 -1
View File
@@ -365,7 +365,7 @@ bool wxToolBar::DoInsertTool(size_t pos, wxToolBarToolBase *toolBase)
wxCHECK_MSG( bitmap.Ok(), false,
wxT("invalid bitmap for wxToolBar icon") );
wxCHECK_MSG( bitmap.GetBitmap() == NULL, false,
wxCHECK_MSG( bitmap.GetDepth() != 1, false,
wxT("wxToolBar doesn't support GdkBitmap") );
wxCHECK_MSG( bitmap.GetPixmap() != NULL, false,