Fixed bitmap problems reported a week ago on the list.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@24101 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling
2003-10-06 15:58:35 +00:00
parent de816bbde3
commit 53f3088ea1
2 changed files with 14 additions and 12 deletions

View File

@@ -101,8 +101,9 @@ void gdk_wx_draw_bitmap(GdkDrawable *drawable,
g_return_if_fail (gc != NULL);
#ifdef __WXGTK20__
if (GDK_WINDOW_DESTROYED(drawable) || GDK_WINDOW_DESTROYED(src))
return;
// This doesn't seem to exist for bitmaps (1-bit)
// if (GDK_WINDOW_DESTROYED(drawable) || GDK_WINDOW_DESTROYED(src))
// return;
gdk_drawable_get_size(src, &src_width, &src_height);
#else
@@ -193,7 +194,7 @@ static void wxInitGCPool()
// If we cannot malloc, then fail with error
// when debug is enabled. If debug is not enabled,
// the problem will eventually get caught
// in wxGetPoolGC.
// in wxGetPoolGC.
wxFAIL_MSG( wxT("Cannot allocate GC pool") );
return;
}
@@ -239,13 +240,13 @@ static GdkGC* wxGetPoolGC( GdkWindow *window, wxPoolGCType type )
// We did not find an available GC.
// We need to grow the GC pool.
pptr = (wxGC *)realloc(wxGCPool,
(wxGCPoolSize + GC_POOL_ALLOC_SIZE)*sizeof(wxGC));
(wxGCPoolSize + GC_POOL_ALLOC_SIZE)*sizeof(wxGC));
if (pptr != NULL)
{
// Initialize newly allocated pool.
wxGCPool = pptr;
memset(&wxGCPool[wxGCPoolSize], 0,
GC_POOL_ALLOC_SIZE*sizeof(wxGC));
memset(&wxGCPool[wxGCPoolSize], 0,
GC_POOL_ALLOC_SIZE*sizeof(wxGC));
// Initialize entry we will return.
wxGCPool[wxGCPoolSize].m_gc = gdk_gc_new( window );

View File

@@ -101,8 +101,9 @@ void gdk_wx_draw_bitmap(GdkDrawable *drawable,
g_return_if_fail (gc != NULL);
#ifdef __WXGTK20__
if (GDK_WINDOW_DESTROYED(drawable) || GDK_WINDOW_DESTROYED(src))
return;
// This doesn't seem to exist for bitmaps (1-bit)
// if (GDK_WINDOW_DESTROYED(drawable) || GDK_WINDOW_DESTROYED(src))
// return;
gdk_drawable_get_size(src, &src_width, &src_height);
#else
@@ -193,7 +194,7 @@ static void wxInitGCPool()
// If we cannot malloc, then fail with error
// when debug is enabled. If debug is not enabled,
// the problem will eventually get caught
// in wxGetPoolGC.
// in wxGetPoolGC.
wxFAIL_MSG( wxT("Cannot allocate GC pool") );
return;
}
@@ -239,13 +240,13 @@ static GdkGC* wxGetPoolGC( GdkWindow *window, wxPoolGCType type )
// We did not find an available GC.
// We need to grow the GC pool.
pptr = (wxGC *)realloc(wxGCPool,
(wxGCPoolSize + GC_POOL_ALLOC_SIZE)*sizeof(wxGC));
(wxGCPoolSize + GC_POOL_ALLOC_SIZE)*sizeof(wxGC));
if (pptr != NULL)
{
// Initialize newly allocated pool.
wxGCPool = pptr;
memset(&wxGCPool[wxGCPoolSize], 0,
GC_POOL_ALLOC_SIZE*sizeof(wxGC));
memset(&wxGCPool[wxGCPoolSize], 0,
GC_POOL_ALLOC_SIZE*sizeof(wxGC));
// Initialize entry we will return.
wxGCPool[wxGCPoolSize].m_gc = gdk_gc_new( window );