From f2424bf1fc393c2999c329c1193d1d9c2997dbd8 Mon Sep 17 00:00:00 2001 From: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> Date: Wed, 25 Feb 2026 16:55:35 +0100 Subject: [PATCH] Further simplification following new minimum supported macOS version: 10.7 - cont'd --- src/drivers/Cocoa/Fl_Cocoa_Window_Driver.cxx | 9 ++++----- src/drivers/Quartz/Fl_Quartz_Graphics_Driver.cxx | 6 ------ 2 files changed, 4 insertions(+), 11 deletions(-) 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().