summaryrefslogtreecommitdiff
path: root/src/drivers
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2016-11-09 09:49:48 +0000
committerManolo Gouy <Manolo>2016-11-09 09:49:48 +0000
commitc530cdeda65fa1479b2a77c63b91e8a947cc32eb (patch)
tree96aee1efca331910e9f30b32969437f79f615d07 /src/drivers
parentf08c41448576d3694f9cf07c7122c9a0e690dbca (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
Diffstat (limited to 'src/drivers')
-rw-r--r--src/drivers/Cocoa/Fl_Cocoa_Screen_Driver.cxx2
-rw-r--r--src/drivers/PostScript/Fl_PostScript.cxx20
-rw-r--r--src/drivers/WinAPI/Fl_WinAPI_Screen_Driver.cxx2
3 files changed, 12 insertions, 12 deletions
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;