Fix storing wxBitmap data in GdkPixbuf

Under wxGTK+2 bitmap data with mask and without it (raw) should be stored
in the separate GdkPixbuf buffers - just like it's done in wxGTK+3. These
two buffers are necessary because only GdkPixbuf with raw bitmap data
(original, non-masked) should be copied when wxBitmapRefData instance is
cloned e.g. in SetMask(). GdkPixbuf with masked data is not copied and is
created on first use in wxBitmap::GetPixbuf().

Closes #18508.
See #18498.
This commit is contained in:
Artur Wieczorek
2019-09-18 23:34:35 +02:00
parent a65c0c29ac
commit f7247086c2
2 changed files with 52 additions and 19 deletions

View File

@@ -133,7 +133,6 @@ public:
#endif
#ifdef __WXGTK3__
GdkPixbuf* GetPixbufNoMask() const;
cairo_t* CairoCreate() const;
void Draw(cairo_t* cr, int x, int y, bool useMask = true, const wxColour* fg = NULL, const wxColour* bg = NULL) const;
void SetSourceSurface(cairo_t* cr, int x, int y, const wxColour* fg = NULL, const wxColour* bg = NULL) const;
@@ -143,6 +142,7 @@ public:
bool HasPixbuf() const;
wxBitmap(GdkPixmap* pixmap);
#endif
GdkPixbuf* GetPixbufNoMask() const;
GdkPixbuf *GetPixbuf() const;
// raw bitmap access support functions