diff options
| author | Manolo Gouy <Manolo> | 2016-11-09 09:49:48 +0000 |
|---|---|---|
| committer | Manolo Gouy <Manolo> | 2016-11-09 09:49:48 +0000 |
| commit | c530cdeda65fa1479b2a77c63b91e8a947cc32eb (patch) | |
| tree | 96aee1efca331910e9f30b32969437f79f615d07 | |
| parent | f08c41448576d3694f9cf07c7122c9a0e690dbca (diff) | |
Use Fl_Graphics_Driver::default_driver() when convenient.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@12088 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
| -rw-r--r-- | FL/fl_draw.H | 2 | ||||
| -rw-r--r-- | src/Fl_Bitmap.cxx | 2 | ||||
| -rw-r--r-- | src/Fl_Image.cxx | 2 | ||||
| -rw-r--r-- | src/Fl_Pixmap.cxx | 2 | ||||
| -rw-r--r-- | src/Fl_cocoa.mm | 8 | ||||
| -rw-r--r-- | src/Fl_win32.cxx | 4 | ||||
| -rw-r--r-- | src/Fl_x.cxx | 2 | ||||
| -rw-r--r-- | src/drivers/Cocoa/Fl_Cocoa_Screen_Driver.cxx | 2 | ||||
| -rw-r--r-- | src/drivers/PostScript/Fl_PostScript.cxx | 20 | ||||
| -rw-r--r-- | src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.cxx | 2 |
10 files changed, 23 insertions, 23 deletions
diff --git a/FL/fl_draw.H b/FL/fl_draw.H index 393f5a88c..65090fd22 100644 --- a/FL/fl_draw.H +++ b/FL/fl_draw.H @@ -759,7 +759,7 @@ inline void fl_draw_image_mono(Fl_Draw_Image_Cb cb, void* data, int X,int Y,int \returns 1 if true alpha blending supported by platform \returns 0 not supported so FLTK will use screen door transparency */ -inline char fl_can_do_alpha_blending() {return Fl_Display_Device::display_device()->driver()->can_do_alpha_blending();} +inline char fl_can_do_alpha_blending() {return Fl_Graphics_Driver::default_driver().can_do_alpha_blending();} FL_EXPORT uchar *fl_read_image(uchar *p,int X,int Y,int W,int H,int alpha=0); diff --git a/src/Fl_Bitmap.cxx b/src/Fl_Bitmap.cxx index 185600c1e..058ef2d56 100644 --- a/src/Fl_Bitmap.cxx +++ b/src/Fl_Bitmap.cxx @@ -34,7 +34,7 @@ Fl_Bitmask fl_create_bitmask(int w, int h, const uchar *array) { } void fl_delete_bitmask(Fl_Bitmask bm) { - return Fl_Display_Device::display_device()->driver()->delete_bitmask(bm); + return Fl_Graphics_Driver::default_driver().delete_bitmask(bm); } // Create a 1-bit mask used for alpha blending diff --git a/src/Fl_Image.cxx b/src/Fl_Image.cxx index 817613c87..6214246ac 100644 --- a/src/Fl_Image.cxx +++ b/src/Fl_Image.cxx @@ -314,7 +314,7 @@ Fl_RGB_Image::~Fl_RGB_Image() { } void Fl_RGB_Image::uncache() { - Fl_Display_Device::display_device()->driver()->uncache(this, id_, mask_); + Fl_Graphics_Driver::default_driver().uncache(this, id_, mask_); } Fl_Image *Fl_RGB_Image::copy(int W, int H) { diff --git a/src/Fl_Pixmap.cxx b/src/Fl_Pixmap.cxx index f6cb61e1e..09ac78a65 100644 --- a/src/Fl_Pixmap.cxx +++ b/src/Fl_Pixmap.cxx @@ -79,7 +79,7 @@ Fl_Pixmap::~Fl_Pixmap() { void Fl_Pixmap::uncache() { if (id_) { - Fl_Display_Device::display_device()->driver()->uncache_pixmap(id_); + Fl_Graphics_Driver::default_driver().uncache_pixmap(id_); id_ = 0; } diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm index 67cda04f7..318c33c06 100644 --- a/src/Fl_cocoa.mm +++ b/src/Fl_cocoa.mm @@ -3245,7 +3245,7 @@ void Fl_Cocoa_Window_Driver::make_current() q_release_context(); Fl_X *i = Fl_X::i(pWindow); fl_window = i->xid; - ((Fl_Quartz_Graphics_Driver*)Fl_Display_Device::display_device()->driver())->high_resolution( mapped_to_retina() ); + ((Fl_Quartz_Graphics_Driver&)Fl_Graphics_Driver::default_driver()).high_resolution( mapped_to_retina() ); NSGraphicsContext *nsgc; #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4 @@ -3255,7 +3255,7 @@ void Fl_Cocoa_Window_Driver::make_current() #endif nsgc = through_Fl_X_flush ? [NSGraphicsContext currentContext] : [NSGraphicsContext graphicsContextWithWindow:fl_window]; gc = (CGContextRef)[nsgc graphicsPort]; - Fl_Display_Device::display_device()->driver()->gc(gc); + Fl_Graphics_Driver::default_driver().gc(gc); CGContextSaveGState(gc); // native context // antialiasing must be deactivated because it applies to rectangles too // and escapes even clipping!!! @@ -3283,13 +3283,13 @@ void Fl_Cocoa_Window_Driver::make_current() // Give the Quartz context back to the system void Fl_Cocoa_Window_Driver::q_release_context(Fl_Cocoa_Window_Driver *x) { - CGContextRef gc = (CGContextRef)Fl_Display_Device::display_device()->driver()->gc(); + CGContextRef gc = (CGContextRef)Fl_Graphics_Driver::default_driver().gc(); if (x && x->shown() && x->gc != gc) return; if (!gc) return; CGContextRestoreGState(gc); // match the CGContextSaveGState's of make_current CGContextRestoreGState(gc); CGContextFlush(gc); - Fl_Display_Device::display_device()->driver()->gc(0); + Fl_Graphics_Driver::default_driver().gc(0); #if defined(FLTK_USE_CAIRO) if (Fl::cairo_autolink_context()) Fl::cairo_make_current((Fl_Window*) 0); // capture gc changes automatically to update the cairo context adequately #endif diff --git a/src/Fl_win32.cxx b/src/Fl_win32.cxx index f3f20a40c..ab1c4c099 100644 --- a/src/Fl_win32.cxx +++ b/src/Fl_win32.cxx @@ -2267,13 +2267,13 @@ HWND fl_window = NULL; // Here we ensure only one GetDC is ever in place. HDC fl_GetDC(HWND w) { - HDC gc = (HDC)Fl_Display_Device::display_device()->driver()->gc(); + HDC gc = (HDC)Fl_Graphics_Driver::default_driver().gc(); if (gc) { if (w == fl_window && fl_window != NULL) return gc; if (fl_window) fl_release_dc(fl_window, gc); // ReleaseDC } gc = GetDC(w); - Fl_Display_Device::display_device()->driver()->gc(gc); + Fl_Graphics_Driver::default_driver().gc(gc); fl_save_dc(w, gc); fl_window = w; // calling GetDC seems to always reset these: (?) diff --git a/src/Fl_x.cxx b/src/Fl_x.cxx index 93ef26d78..6a07175b4 100644 --- a/src/Fl_x.cxx +++ b/src/Fl_x.cxx @@ -616,7 +616,7 @@ void Fl_X11_Screen_Driver::open_display() { fl_open_display(d); // the unique GC used by all X windows GC gc = XCreateGC(fl_display, RootWindow(fl_display, fl_screen), 0, 0); - Fl_Display_Device::display_device()->driver()->gc(gc); + Fl_Graphics_Driver::default_driver().gc(gc); } diff --git a/src/drivers/Cocoa/Fl_Cocoa_Screen_Driver.cxx b/src/drivers/Cocoa/Fl_Cocoa_Screen_Driver.cxx index 9882fa3e9..71a64292d 100644 --- a/src/drivers/Cocoa/Fl_Cocoa_Screen_Driver.cxx +++ b/src/drivers/Cocoa/Fl_Cocoa_Screen_Driver.cxx @@ -136,7 +136,7 @@ void Fl_Cocoa_Screen_Driver::beep(int type) { void Fl_Cocoa_Screen_Driver::flush() { - CGContextRef gc = (CGContextRef)Fl_Display_Device::display_device()->driver()->gc(); + CGContextRef gc = (CGContextRef)Fl_Graphics_Driver::default_driver().gc(); if (gc) CGContextFlush(gc); } diff --git a/src/drivers/PostScript/Fl_PostScript.cxx b/src/drivers/PostScript/Fl_PostScript.cxx index c84fc3295..e764ed0bf 100644 --- a/src/drivers/PostScript/Fl_PostScript.cxx +++ b/src/drivers/PostScript/Fl_PostScript.cxx @@ -903,36 +903,36 @@ static const char *_fontNames[] = { }; void Fl_PostScript_Graphics_Driver::font(int f, int s) { - Fl_Graphics_Driver *driver = Fl_Display_Device::display_device()->driver(); - driver->font(f,s); // Use display fonts for font measurement + Fl_Graphics_Driver& driver = Fl_Graphics_Driver::default_driver(); + driver.font(f,s); // Use display fonts for font measurement Fl_Graphics_Driver::font(f, s); - Fl_Font_Descriptor *desc = driver->font_descriptor(); + Fl_Font_Descriptor *desc = driver.font_descriptor(); this->font_descriptor(desc); if (f < FL_FREE_FONT) { fprintf(output, "/%s SF\n" , _fontNames[f]); - float ps_size = driver->scale_font_for_PostScript(desc, s); + float ps_size = driver.scale_font_for_PostScript(desc, s); clocale_printf("%.1f FS\n", ps_size); } } double Fl_PostScript_Graphics_Driver::width(const char *s, int n) { - return Fl_Display_Device::display_device()->driver()->width(s, n); + return Fl_Graphics_Driver::default_driver().width(s, n); } double Fl_PostScript_Graphics_Driver::width(unsigned u) { - return Fl_Display_Device::display_device()->driver()->width(u); + return Fl_Graphics_Driver::default_driver().width(u); } int Fl_PostScript_Graphics_Driver::height() { - return Fl_Display_Device::display_device()->driver()->height(); + return Fl_Graphics_Driver::default_driver().height(); } int Fl_PostScript_Graphics_Driver::descent() { - return Fl_Display_Device::display_device()->driver()->descent(); + return Fl_Graphics_Driver::default_driver().descent(); } void Fl_PostScript_Graphics_Driver::text_extents(const char *c, int n, int &dx, int &dy, int &w, int &h) { - Fl_Display_Device::display_device()->driver()->text_extents(c, n, dx, dy, w, h); + Fl_Graphics_Driver::default_driver().text_extents(c, n, dx, dy, w, h); } @@ -998,7 +998,7 @@ static uchar *calc_mask(uchar *img, int w, int h, Fl_Color bg) void Fl_PostScript_Graphics_Driver::transformed_draw_extra(const char* str, int n, double x, double y, int w, bool rtl) { // scale for bitmask computation is set to 1 when we can't expect to have scalable fonts - float scale = Fl_Display_Device::display_device()->driver()->scale_bitmap_for_PostScript(); + float scale = Fl_Graphics_Driver::default_driver().scale_bitmap_for_PostScript(); Fl_Fontsize old_size = size(); Fl_Font fontnum = Fl_Graphics_Driver::font(); int w_scaled = (int)(w * (scale + 0.5)); diff --git a/src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.cxx b/src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.cxx index c8fd4a2e0..6c3e99dca 100644 --- a/src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.cxx +++ b/src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.cxx @@ -56,7 +56,7 @@ int Fl_WinAPI_Screen_Driver::visual(int flags) { fl_GetDC(0); if (flags & FL_DOUBLE) return 0; - HDC gc = (HDC)Fl_Display_Device::display_device()->driver()->gc(); + HDC gc = (HDC)Fl_Graphics_Driver::default_driver().gc(); if (!(flags & FL_INDEX) && GetDeviceCaps(gc,BITSPIXEL) <= 8) return 0; if ((flags & FL_RGB8) && GetDeviceCaps(gc,BITSPIXEL)<24) return 0; |
