summaryrefslogtreecommitdiff
path: root/src/drivers
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2016-02-25 10:14:28 +0000
committerManolo Gouy <Manolo>2016-02-25 10:14:28 +0000
commit31793cbdba8e318350c5ed11b06d5a678eb15608 (patch)
tree6663410ff80abfa841ebf30a9a7f75bffeb730ac /src/drivers
parente24f3f79a334a501c9a239b32fe465981a8c3aab (diff)
Remove the global variable fl_mask_bitmap - put it in the graphics driver's virtual API.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11216 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/drivers')
-rw-r--r--src/drivers/GDI/Fl_GDI_Graphics_Driver.h4
-rw-r--r--src/drivers/GDI/Fl_GDI_Graphics_Driver_image.cxx5
-rw-r--r--src/drivers/Xlib/Fl_Xlib_Graphics_Driver.cxx1
-rw-r--r--src/drivers/Xlib/Fl_Xlib_Graphics_Driver.h3
-rw-r--r--src/drivers/Xlib/Fl_Xlib_Graphics_Driver_image.cxx5
5 files changed, 12 insertions, 6 deletions
diff --git a/src/drivers/GDI/Fl_GDI_Graphics_Driver.h b/src/drivers/GDI/Fl_GDI_Graphics_Driver.h
index d49df4e90..32c17d1b9 100644
--- a/src/drivers/GDI/Fl_GDI_Graphics_Driver.h
+++ b/src/drivers/GDI/Fl_GDI_Graphics_Driver.h
@@ -38,7 +38,11 @@ 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; }
public:
+ Fl_GDI_Graphics_Driver() {mask_bitmap_ = NULL;}
static const char *class_id;
const char *class_name() {return class_id;};
virtual int has_feature(driver_feature mask) { return mask & NATIVE; }
diff --git a/src/drivers/GDI/Fl_GDI_Graphics_Driver_image.cxx b/src/drivers/GDI/Fl_GDI_Graphics_Driver_image.cxx
index 5ce2c5822..dca25ef8d 100644
--- a/src/drivers/GDI/Fl_GDI_Graphics_Driver_image.cxx
+++ b/src/drivers/GDI/Fl_GDI_Graphics_Driver_image.cxx
@@ -627,18 +627,17 @@ void Fl_GDI_Printer_Graphics_Driver::draw(Fl_Pixmap *pxm, int XP, int YP, int WP
}
}
-extern uchar **fl_mask_bitmap;
fl_uintptr_t Fl_GDI_Graphics_Driver::cache(Fl_Pixmap *img, int w, int h, const char *const*data) {
Fl_Offscreen id;
id = fl_create_offscreen(w, h);
fl_begin_offscreen(id);
uchar *bitmap = 0;
- fl_mask_bitmap = &bitmap;
+ mask_bitmap(&bitmap);
fl_draw_pixmap(data, 0, 0, FL_BLACK);
extern UINT win_pixmap_bg_color; // computed by fl_draw_pixmap()
img->pixmap_bg_color = win_pixmap_bg_color;
- fl_mask_bitmap = 0;
+ mask_bitmap(0);
if (bitmap) {
img->mask_ = (fl_uintptr_t)fl_create_bitmask(w, h, bitmap);
delete[] bitmap;
diff --git a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver.cxx b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver.cxx
index 9eb716ace..ebaf0792b 100644
--- a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver.cxx
+++ b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver.cxx
@@ -59,6 +59,7 @@ Fl_Xlib_Graphics_Driver::Fl_Xlib_Graphics_Driver(void) {
gc_ = XCreateGC(fl_display, RootWindow(fl_display, fl_screen), 0, 0);
fl_gc = gc_;
}
+ mask_bitmap_ = NULL;
}
char Fl_Xlib_Graphics_Driver::can_do_alpha_blending() {
diff --git a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver.h b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver.h
index 276316213..7c1f4799a 100644
--- a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver.h
+++ b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver.h
@@ -35,6 +35,9 @@
class FL_EXPORT Fl_Xlib_Graphics_Driver : public Fl_Graphics_Driver {
protected:
static GC gc_;
+ uchar **mask_bitmap_;
+ uchar **mask_bitmap() {return mask_bitmap_;}
+ void mask_bitmap(uchar **value) { mask_bitmap_ = value; }
public:
static const char *class_id;
Fl_Xlib_Graphics_Driver(void);
diff --git a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_image.cxx b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_image.cxx
index 591203174..53aa48a13 100644
--- a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_image.cxx
+++ b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_image.cxx
@@ -806,16 +806,15 @@ void Fl_Xlib_Graphics_Driver::draw(Fl_Pixmap *pxm, int XP, int YP, int WP, int H
else copy_offscreen(X, Y, W, H, pxm->id_, cx, cy);
}
-extern uchar **fl_mask_bitmap; // if non-zero, create bitmap and store pointer here
fl_uintptr_t Fl_Xlib_Graphics_Driver::cache(Fl_Pixmap *img, int w, int h, const char *const*data) {
Fl_Offscreen id;
id = fl_create_offscreen(w, h);
fl_begin_offscreen(id);
uchar *bitmap = 0;
- fl_mask_bitmap = &bitmap;
+ mask_bitmap(&bitmap);
fl_draw_pixmap(data, 0, 0, FL_BLACK);
- fl_mask_bitmap = 0;
+ mask_bitmap(0);
if (bitmap) {
img->mask_ = (fl_uintptr_t)fl_create_bitmask(w, h, bitmap);
delete[] bitmap;