diff options
| author | Manolo Gouy <Manolo> | 2016-02-18 16:21:51 +0000 |
|---|---|---|
| committer | Manolo Gouy <Manolo> | 2016-02-18 16:21:51 +0000 |
| commit | f33b45f1d30653fb5da4817089e38ff0a2413cfb (patch) | |
| tree | 9edc759690defa581b00b6ada80bb334f4ac5da8 /src/Fl_Window_shape.cxx | |
| parent | 6ce27012a9412c4964e0ae40c81ea92ff39a61d3 (diff) | |
Remove all uses of the fl_gc global variable. Towards a clean driver model.
fl_gc remains usable by the application as a hook into the system.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11189 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_Window_shape.cxx')
| -rw-r--r-- | src/Fl_Window_shape.cxx | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/Fl_Window_shape.cxx b/src/Fl_Window_shape.cxx index 4e71197f3..5dee92238 100644 --- a/src/Fl_Window_shape.cxx +++ b/src/Fl_Window_shape.cxx @@ -3,7 +3,7 @@ // // Implementation of Fl_Window::shape(Fl_Image*) for the Fast Light Tool Kit (FLTK). // -// Copyright 2010-2015 by Bill Spitzak and others. +// Copyright 2010-2016 by Bill Spitzak and others. // // This library is free software. Distribution and use rights are outlined in // the file "COPYING" which should have been included with this file. If this @@ -342,12 +342,15 @@ void Fl_Window::shape(const Fl_Image* img) { } void Fl_Window::draw() { +#if defined(__APPLE__) + CGContextRef gc = (CGContextRef)Fl_Display_Device::display_device()->driver()->get_gc(); +#endif if (shape_data_) { # if defined(__APPLE__) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4 if (shape_data_->mask && (&CGContextClipToMask != NULL)) { - CGContextClipToMask(fl_gc, CGRectMake(0,0,w(),h()), shape_data_->mask); // requires Mac OS 10.4 + CGContextClipToMask(gc, CGRectMake(0,0,w(),h()), shape_data_->mask); // requires Mac OS 10.4 } - CGContextSaveGState(fl_gc); + CGContextSaveGState(gc); #elif defined(WIN32) if ((shape_data_->lw_ != w() || shape_data_->lh_ != h()) && shape_data_->shape_) { // size of window has changed since last time @@ -394,7 +397,7 @@ void Fl_Window::draw() { #ifdef __APPLE_QUARTZ__ // PORTME: Fl_Window_Driver - platform window driver // on OS X, windows have no frame. Before OS X 10.7, to resize a window, we drag the lower right // corner. This code draws a little ribbed triangle for dragging. - if (fl_mac_os_version < 100700 && fl_gc && !parent() && resizable() && + if (fl_mac_os_version < 100700 && gc && !parent() && resizable() && (!size_range_set || minh!=maxh || minw!=maxw)) { int dx = Fl::box_dw(box())-Fl::box_dx(box()); int dy = Fl::box_dh(box())-Fl::box_dy(box()); @@ -415,7 +418,7 @@ void Fl_Window::draw() { } #endif # if defined(__APPLE__) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4 - if (shape_data_) CGContextRestoreGState(fl_gc); + if (shape_data_) CGContextRestoreGState(gc); # endif # if defined(FLTK_USE_CAIRO) |
