diff --git a/src/drivers/Cocoa/Fl_Cocoa_Window_Driver.cxx b/src/drivers/Cocoa/Fl_Cocoa_Window_Driver.cxx index 55d1bea32..341f17c97 100644 --- a/src/drivers/Cocoa/Fl_Cocoa_Window_Driver.cxx +++ b/src/drivers/Cocoa/Fl_Cocoa_Window_Driver.cxx @@ -72,9 +72,8 @@ void Fl_Cocoa_Window_Driver::flush_overlay() void Fl_Cocoa_Window_Driver::draw_begin() { - if (!Fl_Surface_Device::surface()->driver()->has_feature(Fl_Graphics_Driver::NATIVE)) return; - CGContextRef my_gc = (CGContextRef)Fl_Surface_Device::surface()->driver()->gc(); - if (shape_data_) { + if (shape_data_ && Fl_Surface_Device::surface()->driver()->has_feature(Fl_Graphics_Driver::NATIVE)) { + CGContextRef my_gc = (CGContextRef)Fl_Surface_Device::surface()->driver()->gc(); if (shape_data_->mask) { CGContextClipToMask(my_gc, CGRectMake(0,0,w(),h()), shape_data_->mask); // requires Mac OS 10.4 } @@ -85,9 +84,9 @@ void Fl_Cocoa_Window_Driver::draw_begin() void Fl_Cocoa_Window_Driver::draw_end() { - if (Fl_Surface_Device::surface()->driver()->has_feature(Fl_Graphics_Driver::NATIVE)) { + if (shape_data_ && Fl_Surface_Device::surface()->driver()->has_feature(Fl_Graphics_Driver::NATIVE)) { CGContextRef my_gc = (CGContextRef)Fl_Surface_Device::surface()->driver()->gc(); - if (shape_data_) CGContextRestoreGState(my_gc); + CGContextRestoreGState(my_gc); } } diff --git a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver.cxx b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver.cxx index 21c5eda4c..4e3ed0332 100644 --- a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver.cxx +++ b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver.cxx @@ -43,12 +43,6 @@ char Fl_Quartz_Graphics_Driver::can_do_alpha_blending() { return 1; } -static void bmProviderRelease (void *src, const void *data, size_t size) { - CFIndex count = CFGetRetainCount(src); - CFRelease(src); - if(count == 1) free((void*)data); -} - /* Reference to the current CGContext For back-compatibility only. The preferred procedure to get this reference is Fl_Surface_Device::surface()->driver()->gc().