summaryrefslogtreecommitdiff
path: root/src/drivers/Quartz/Fl_Quartz_Graphics_Driver.cxx
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2016-10-14 09:17:15 +0000
committerManolo Gouy <Manolo>2016-10-14 09:17:15 +0000
commit7a81273a0cfe5128ce7b6454dbd325d6461fd5cd (patch)
tree587160d37000fad63db08a498532cd82d7cec0de /src/drivers/Quartz/Fl_Quartz_Graphics_Driver.cxx
parent2b5fbbacfcfe6465feb8ca3be65931e42c22f2dd (diff)
MacOS: finer control of the compilation conditions under which Core text and ATSU are used or not.
The compilation conditions depend on the targeted architecture, what version of the SDK is used, and what MacOS deployment version is used. Under most conditions, a single API is possible, and no pointer-to-member function is used. But the code supports building apps that can run both APIs depending on the version of the running MacOS. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@12025 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/drivers/Quartz/Fl_Quartz_Graphics_Driver.cxx')
-rw-r--r--src/drivers/Quartz/Fl_Quartz_Graphics_Driver.cxx14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver.cxx b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver.cxx
index 5fd811e1a..26f12d6e5 100644
--- a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver.cxx
+++ b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver.cxx
@@ -21,6 +21,7 @@
#include "../Darwin/Fl_Darwin_System_Driver.H"
#include <FL/x.H>
+#if HAS_ATSU && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
Fl_Quartz_Graphics_Driver::pter_to_draw_member Fl_Quartz_Graphics_Driver::CoreText_or_ATSU_draw;
Fl_Quartz_Graphics_Driver::pter_to_width_member Fl_Quartz_Graphics_Driver::CoreText_or_ATSU_width;
@@ -28,7 +29,6 @@ int Fl_Quartz_Graphics_Driver::CoreText_or_ATSU = 0;
void Fl_Quartz_Graphics_Driver::init_CoreText_or_ATSU()
{
-#if HAS_ATSU && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
if (Fl_Darwin_System_Driver::calc_mac_os_version() < 100500) {
// before Mac OS 10.5, only ATSU is available
CoreText_or_ATSU = use_ATSU;
@@ -39,16 +39,8 @@ void Fl_Quartz_Graphics_Driver::init_CoreText_or_ATSU()
CoreText_or_ATSU_draw = &Fl_Quartz_Graphics_Driver::draw_CoreText;
CoreText_or_ATSU_width = &Fl_Quartz_Graphics_Driver::width_CoreText;
}
-#elif MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_5
- CoreText_or_ATSU = use_ATSU;
- CoreText_or_ATSU_draw = &Fl_Quartz_Graphics_Driver::draw_ATSU;
- CoreText_or_ATSU_width = &Fl_Quartz_Graphics_Driver::width_ATSU;
-#else
- CoreText_or_ATSU = use_CoreText;
- CoreText_or_ATSU_draw = &Fl_Quartz_Graphics_Driver::draw_CoreText;
- CoreText_or_ATSU_width = &Fl_Quartz_Graphics_Driver::width_CoreText;
-#endif
}
+#endif
/*
* By linking this module, the following static method will instantiate the
@@ -66,7 +58,9 @@ Fl_Quartz_Graphics_Driver::Fl_Quartz_Graphics_Driver() : Fl_Graphics_Driver(), g
quartz_line_pattern = 0;
quartz_line_pattern_size = 0;
high_resolution_ = false;
+#if HAS_ATSU && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
if (!CoreText_or_ATSU) init_CoreText_or_ATSU();
+#endif
}
char Fl_Quartz_Graphics_Driver::can_do_alpha_blending() {