diff options
| -rw-r--r-- | FL/Fl_Graphics_Driver.H | 4 | ||||
| -rw-r--r-- | src/drivers/GDI/Fl_GDI_Graphics_Driver.h | 2 | ||||
| -rw-r--r-- | src/drivers/Quartz/Fl_Quartz_Graphics_Driver.h | 2 | ||||
| -rw-r--r-- | src/drivers/Xlib/Fl_Xlib_Graphics_Driver.cxx | 2 |
4 files changed, 4 insertions, 6 deletions
diff --git a/FL/Fl_Graphics_Driver.H b/FL/Fl_Graphics_Driver.H index 3dedcf5d9..75a840d6d 100644 --- a/FL/Fl_Graphics_Driver.H +++ b/FL/Fl_Graphics_Driver.H @@ -88,8 +88,6 @@ class FL_EXPORT Fl_Graphics_Driver : public Fl_Device { friend class Fl_Pixmap; friend class Fl_Bitmap; friend class Fl_RGB_Image; -private: - void global_gc(void); public: // The following functions create the various graphics drivers that are required // for core operations. They must be implemented as members of Fl_Graphics_Driver, @@ -138,7 +136,6 @@ public: virtual const char *class_name() {return class_id;}; Fl_Graphics_Driver(); virtual ~Fl_Graphics_Driver() { if (p) free(p); } -public: virtual char can_do_alpha_blending() { return 0; } // --- implementation is in src/fl_rect.cxx which includes src/drivers/xxx/Fl_xxx_Graphics_Driver_rect.cxx virtual void point(int x, int y) = 0; @@ -262,6 +259,7 @@ protected: // --- implementation is in src/fl_vertex.cxx which includes src/cfg_gfx/xxx_rect.cxx virtual void transformed_vertex0(COORD_T x, COORD_T y); virtual void fixloop(); + void global_gc(void); }; #endif // FL_GRAPHICS_DRIVER_H diff --git a/src/drivers/GDI/Fl_GDI_Graphics_Driver.h b/src/drivers/GDI/Fl_GDI_Graphics_Driver.h index 722c7410a..6fd93dbfc 100644 --- a/src/drivers/GDI/Fl_GDI_Graphics_Driver.h +++ b/src/drivers/GDI/Fl_GDI_Graphics_Driver.h @@ -43,7 +43,7 @@ public: const char *class_name() {return class_id;}; virtual int has_feature(driver_feature mask) { return mask & NATIVE; } char can_do_alpha_blending(); - virtual void set_gc(void *ctxt) {gc = (HDC)ctxt;} + virtual void set_gc(void *ctxt) {if (ctxt != gc) global_gc(); gc = (HDC)ctxt;} virtual void *get_gc() {return gc;} // --- bitmap stuff diff --git a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver.h b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver.h index c9a6c916e..3e069040f 100644 --- a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver.h +++ b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver.h @@ -44,7 +44,7 @@ public: static const char *class_id; const char *class_name() {return class_id;}; virtual int has_feature(driver_feature mask) { return mask & NATIVE; } - virtual void set_gc(void *ctxt) {gc = (CGContextRef)ctxt;} + virtual void set_gc(void *ctxt) {if (ctxt != gc) global_gc(); gc = (CGContextRef)ctxt; } virtual void *get_gc() {return gc;} char can_do_alpha_blending(); diff --git a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver.cxx b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver.cxx index b9ac31eff..0a7950388 100644 --- a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver.cxx +++ b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver.cxx @@ -37,7 +37,6 @@ GC fl_gc = 0; void Fl_Graphics_Driver::global_gc() { - fl_gc = (GC)get_gc(); } @@ -57,6 +56,7 @@ Fl_Xlib_Graphics_Driver::Fl_Xlib_Graphics_Driver(void) { fl_open_display(); // the unique GC used by all X windows gc = XCreateGC(fl_display, RootWindow(fl_display, fl_screen), 0, 0); + fl_gc = gc; } } |
