From c407f6e2bda170aa448c01d41c44b9cd9a2e3dd6 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 3 Jan 2014 01:06:45 +0000 Subject: [PATCH] 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 --- src/gtk/bitmap.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/gtk/bitmap.cpp b/src/gtk/bitmap.cpp index 6ab6bcb628..f81e7104a8 100644 --- a/src/gtk/bitmap.cpp +++ b/src/gtk/bitmap.cpp @@ -1428,6 +1428,11 @@ void *wxBitmap::GetRawData(wxPixelDataBase& data, int bpp) } #else 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(); // allow access if bpp is valid and matches existence of alpha