Don't keep using the old wxBitmap data after modifying it directly in wxGTK.

Drawing on a wxBitmap via wxMemoryDC modified its pixmap representation in
wxGTK and even if its pixbuf representation was later changed using direct
access to the bitmap pixels, the out of date pixmap continued to be used,
creating the illusion of direct access being completely ignored.

Fix this by purging the old pixmap representation when locking the bitmap for
raw access.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75517 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2014-01-03 01:06:45 +00:00
parent 6f25e45af1
commit c407f6e2bd

View File

@@ -1428,6 +1428,11 @@ void *wxBitmap::GetRawData(wxPixelDataBase& data, int bpp)
} }
#else #else
GdkPixbuf *pixbuf = GetPixbuf(); GdkPixbuf *pixbuf = GetPixbuf();
// Pixmap will get out of date when our pixbuf is accessed directly, so
// ensure we don't keep the old data in it.
PurgeOtherRepresentations(Pixbuf);
const bool hasAlpha = HasAlpha(); const bool hasAlpha = HasAlpha();
// allow access if bpp is valid and matches existence of alpha // allow access if bpp is valid and matches existence of alpha