summaryrefslogtreecommitdiff
path: root/src/drivers/GDI
diff options
context:
space:
mode:
authorMatthias Melcher <github@matthiasm.com>2022-11-25 10:52:46 +0100
committerMatthias Melcher <github@matthiasm.com>2022-11-25 10:52:46 +0100
commit09697c47385b2b4749f41e2862b0e93eb9933092 (patch)
tree56200646314b581d1aa47f277a5ae3b1b13541b0 /src/drivers/GDI
parentb1ba37c5ba1df543baa87d328805af34da4bd2b1 (diff)
Fix GDI graphics driver use for bitmasks
Diffstat (limited to 'src/drivers/GDI')
-rw-r--r--src/drivers/GDI/Fl_GDI_Graphics_Driver_image.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/drivers/GDI/Fl_GDI_Graphics_Driver_image.cxx b/src/drivers/GDI/Fl_GDI_Graphics_Driver_image.cxx
index 9e512d889..d3e23be9f 100644
--- a/src/drivers/GDI/Fl_GDI_Graphics_Driver_image.cxx
+++ b/src/drivers/GDI/Fl_GDI_Graphics_Driver_image.cxx
@@ -803,7 +803,11 @@ void Fl_GDI_Graphics_Driver::cache(Fl_Pixmap *img) {
fl_draw_pixmap(img->data(), 0, 0, FL_BLACK);
uchar *bitmap = *pbitmap;
if (bitmap) {
- *Fl_Graphics_Driver::mask(img) = (fl_uintptr_t)create_bitmask(img->data_w(), img->data_h(), bitmap);
+ // Note: activating the surface device changes graphics drivers.
+ // Don't use 'this', but the new driver instead.
+ *Fl_Graphics_Driver::mask(img) =
+ (fl_uintptr_t)((Fl_GDI_Graphics_Driver *)fl_graphics_driver)->
+ create_bitmask(img->data_w(), img->data_h(), bitmap);
delete[] bitmap;
}
*pbitmap = 0;