diff options
| -rw-r--r-- | FL/Fl_Graphics_Driver.H | 2 | ||||
| -rw-r--r-- | src/drivers/GDI/Fl_GDI_Graphics_Driver.H | 5 | ||||
| -rw-r--r-- | src/drivers/GDI/Fl_GDI_Graphics_Driver_image.cxx | 9 | ||||
| -rw-r--r-- | src/drivers/Xlib/Fl_Xlib_Graphics_Driver.H | 5 | ||||
| -rw-r--r-- | src/drivers/Xlib/Fl_Xlib_Graphics_Driver_image.cxx | 7 |
5 files changed, 13 insertions, 15 deletions
diff --git a/FL/Fl_Graphics_Driver.H b/FL/Fl_Graphics_Driver.H index 295a8e2e0..5fb18f75f 100644 --- a/FL/Fl_Graphics_Driver.H +++ b/FL/Fl_Graphics_Driver.H @@ -407,8 +407,6 @@ public: virtual void *gc(void) {return NULL;} /** Support for pixmap drawing */ virtual uchar **mask_bitmap() { return 0; } - /** Support for pixmap drawing */ - virtual void mask_bitmap(uchar **) {} // default implementation may be enough /** Support for PostScript drawing */ virtual float scale_font_for_PostScript(Fl_Font_Descriptor *desc, int s) { return float(s); } diff --git a/src/drivers/GDI/Fl_GDI_Graphics_Driver.H b/src/drivers/GDI/Fl_GDI_Graphics_Driver.H index f4910fc47..bca0b2177 100644 --- a/src/drivers/GDI/Fl_GDI_Graphics_Driver.H +++ b/src/drivers/GDI/Fl_GDI_Graphics_Driver.H @@ -48,9 +48,8 @@ protected: HDC gc_; int numcount; int counts[20]; - uchar **mask_bitmap_; - uchar **mask_bitmap() {return mask_bitmap_;} - void mask_bitmap(uchar **value) { mask_bitmap_ = value; } + uchar *mask_bitmap_; + uchar **mask_bitmap() {return &mask_bitmap_;} int p_size; POINT *p; public: diff --git a/src/drivers/GDI/Fl_GDI_Graphics_Driver_image.cxx b/src/drivers/GDI/Fl_GDI_Graphics_Driver_image.cxx index fc63f727a..4ad9d5509 100644 --- a/src/drivers/GDI/Fl_GDI_Graphics_Driver_image.cxx +++ b/src/drivers/GDI/Fl_GDI_Graphics_Driver_image.cxx @@ -687,15 +687,16 @@ void Fl_GDI_Printer_Graphics_Driver::draw_pixmap(Fl_Pixmap *pxm, int XP, int YP, void Fl_GDI_Graphics_Driver::cache(Fl_Pixmap *img) { Fl_Image_Surface *surf = new Fl_Image_Surface(img->data_w(), img->data_h()); Fl_Surface_Device::push_current(surf); - uchar *bitmap = 0; - Fl_Surface_Device::surface()->driver()->mask_bitmap(&bitmap); + uchar **pbitmap = surf->driver()->mask_bitmap(); + *pbitmap = 0; fl_draw_pixmap(img->data(), 0, 0, FL_BLACK); *Fl_Graphics_Driver::pixmap_bg_color(img) = Fl_WinAPI_System_Driver::win_pixmap_bg_color; // computed by fl_draw_pixmap() - Fl_Surface_Device::surface()->driver()->mask_bitmap(0); + uchar *bitmap = *pbitmap; if (bitmap) { - *Fl_Graphics_Driver::mask(img) = (fl_uintptr_t)fl_create_bitmask(img->data_w(), img->data_h(), bitmap); + *Fl_Graphics_Driver::mask(img) = (fl_uintptr_t)create_bitmask(img->data_w(), img->data_h(), bitmap); delete[] bitmap; } + *pbitmap = 0; Fl_Surface_Device::pop_current(); Fl_Offscreen id = surf->get_offscreen_before_delete(); delete surf; diff --git a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver.H b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver.H index 35f7c01aa..4eeb742f3 100644 --- a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver.H +++ b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver.H @@ -91,9 +91,8 @@ protected: static void init_built_in_fonts(); #endif static GC gc_; - uchar **mask_bitmap_; - uchar **mask_bitmap() {return mask_bitmap_;} - void mask_bitmap(uchar **value) { mask_bitmap_ = value; } + uchar *mask_bitmap_; + uchar **mask_bitmap() {return &mask_bitmap_;} int p_size; typedef struct {short x, y;} XPOINT; XPOINT *p; diff --git a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_image.cxx b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_image.cxx index dd8c136d2..80fe2c8ce 100644 --- a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_image.cxx +++ b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_image.cxx @@ -869,14 +869,15 @@ void Fl_Xlib_Graphics_Driver::draw_fixed(Fl_Pixmap *pxm, int X, int Y, int W, in void Fl_Xlib_Graphics_Driver::cache(Fl_Pixmap *pxm) { Fl_Image_Surface *surf = new Fl_Image_Surface(pxm->data_w(), pxm->data_h()); Fl_Surface_Device::push_current(surf); - uchar *bitmap = 0; - Fl_Surface_Device::surface()->driver()->mask_bitmap(&bitmap); + uchar **pbitmap = surf->driver()->mask_bitmap(); + *pbitmap = 0; fl_draw_pixmap(pxm->data(), 0, 0, FL_BLACK); - Fl_Surface_Device::surface()->driver()->mask_bitmap(0); + uchar *bitmap = *pbitmap; if (bitmap) { *Fl_Graphics_Driver::mask(pxm) = (fl_uintptr_t)create_bitmask(pxm->data_w(), pxm->data_h(), bitmap); delete[] bitmap; } + *pbitmap = 0; Fl_Surface_Device::pop_current(); Fl_Offscreen id = surf->get_offscreen_before_delete(); delete surf; |
