summaryrefslogtreecommitdiff
path: root/src/drivers/Quartz/Fl_Quartz_Image_Surface_Driver.cxx
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2026-02-01 16:32:21 +0100
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2026-02-01 16:32:21 +0100
commite0405d2135939d08289205e3a38df329076e16c1 (patch)
tree4d4facf614ba6062a2df194bd14d2f99021cfad7 /src/drivers/Quartz/Fl_Quartz_Image_Surface_Driver.cxx
parent4be596a30673a67ee7d5a0bdc8095922a498eed5 (diff)
macOS: remove code present only to support macOS versions 10.3 and 10.4.
This is a first step towards removing the code related to support of old macOS versions that are not compatible with C++11 which FLTK 1.5 requires.
Diffstat (limited to 'src/drivers/Quartz/Fl_Quartz_Image_Surface_Driver.cxx')
-rw-r--r--src/drivers/Quartz/Fl_Quartz_Image_Surface_Driver.cxx16
1 files changed, 1 insertions, 15 deletions
diff --git a/src/drivers/Quartz/Fl_Quartz_Image_Surface_Driver.cxx b/src/drivers/Quartz/Fl_Quartz_Image_Surface_Driver.cxx
index 1e3d6b927..4615ba475 100644
--- a/src/drivers/Quartz/Fl_Quartz_Image_Surface_Driver.cxx
+++ b/src/drivers/Quartz/Fl_Quartz_Image_Surface_Driver.cxx
@@ -1,7 +1,7 @@
//
// Draw-to-image code for the Fast Light Tool Kit (FLTK).
//
-// Copyright 1998-2023 by Bill Spitzak and others.
+// Copyright 1998-2026 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
@@ -23,9 +23,7 @@
Fl_Quartz_Image_Surface_Driver::Fl_Quartz_Image_Surface_Driver(int w, int h, int high_res, Fl_Offscreen off) : Fl_Image_Surface_Driver(w, h, high_res, off) {
-# if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4
mask_ = NULL;
-#endif
int W = w, H = h;
float s = 1;
if (high_res) {
@@ -53,11 +51,9 @@ Fl_Quartz_Image_Surface_Driver::Fl_Quartz_Image_Surface_Driver(int w, int h, int
}
Fl_Quartz_Image_Surface_Driver::~Fl_Quartz_Image_Surface_Driver() {
-# if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4
if (mask_) {
CGImageRelease(mask_);
}
-#endif
if (offscreen) CGContextRestoreGState((CGContextRef)offscreen);
if (offscreen && !external_offscreen) {
void *data = CGBitmapContextGetData((CGContextRef)offscreen);
@@ -74,7 +70,6 @@ void Fl_Quartz_Image_Surface_Driver::set_current() {
driver()->gc((CGContextRef)offscreen);
fl_window = 0;
((Fl_Quartz_Graphics_Driver*)driver())->high_resolution( CGBitmapContextGetWidth((CGContextRef)offscreen) > (size_t)width );
-# if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4
if (mask_) {
int W, H;
printable_rect(&W, &H);
@@ -82,7 +77,6 @@ void Fl_Quartz_Image_Surface_Driver::set_current() {
CGContextClipToMask((CGContextRef)offscreen, CGRectMake(0,0,W,H), mask_); // 10.4
CGContextSaveGState((CGContextRef)offscreen);
}
-# endif
}
void Fl_Quartz_Image_Surface_Driver::translate(int x, int y) {
@@ -99,13 +93,11 @@ void Fl_Quartz_Image_Surface_Driver::untranslate() {
Fl_RGB_Image* Fl_Quartz_Image_Surface_Driver::image()
{
CGContextFlush((CGContextRef)offscreen);
-# if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4
if (mask_) {
CGContextRestoreGState((CGContextRef)offscreen);
CGImageRelease(mask_);
mask_ = NULL;
}
-#endif
int W = (int)CGBitmapContextGetWidth((CGContextRef)offscreen);
int H = (int)CGBitmapContextGetHeight((CGContextRef)offscreen);
int bpr = (int)CGBitmapContextGetBytesPerRow((CGContextRef)offscreen);
@@ -128,19 +120,15 @@ Fl_RGB_Image* Fl_Quartz_Image_Surface_Driver::image()
void Fl_Quartz_Image_Surface_Driver::end_current()
{
-# if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4
if (mask_) {
CGContextRestoreGState((CGContextRef)offscreen);
CGContextRestoreGState((CGContextRef)offscreen);
}
-# endif
fl_window = pre_window;
Fl_Surface_Device::end_current();
}
-# if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4
-
static void MyProviderReleaseData (void *info, const void *data, size_t size) {
delete[] (uchar*)data;
}
@@ -177,5 +165,3 @@ void Fl_Quartz_Image_Surface_Driver::mask(const Fl_RGB_Image *img) {
CFRelease(provider);
if (using_copy) delete img;
}
-
-#endif