From f2e249c0a6a93f12808822cc5e5dddda35a09a35 Mon Sep 17 00:00:00 2001 From: Sean McBride <sean@rogue-research.com> Date: Wed, 10 Aug 2016 13:01:23 -0400 Subject: [PATCH] Drop support of OS X 10.6.x; remove workarounds for it --- CMakeLists.txt | 4 +- README.md | 2 +- .../LIC/vtkLineIntegralConvolution2D.cxx | 11 +--- Rendering/OpenGL/vtkCocoaGLView.mm | 12 ---- .../OpenGL/vtkCocoaMacOSXSDKCompatibility.h | 15 ++--- Rendering/OpenGL/vtkCocoaRenderWindow.h | 3 +- Rendering/OpenGL/vtkCocoaRenderWindow.mm | 53 ---------------- .../OpenGL/vtkCoreGraphicsGPUInfoList.cxx | 5 -- Rendering/OpenGL2/vtkCocoaGLView.mm | 12 ---- .../OpenGL2/vtkCocoaMacOSXSDKCompatibility.h | 15 ++--- Rendering/OpenGL2/vtkCocoaRenderWindow.h | 3 +- Rendering/OpenGL2/vtkCocoaRenderWindow.mm | 60 +------------------ Rendering/OpenGL2/vtkIOSRenderWindow.h | 3 +- .../vtkOpenGLGPUVolumeRayCastMapper.cxx | 21 ------- 14 files changed, 18 insertions(+), 201 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a4c2a4227c..bb9ecc60a4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -266,8 +266,8 @@ if(APPLE) ) if (CMAKE_OSX_DEPLOYMENT_TARGET AND - CMAKE_OSX_DEPLOYMENT_TARGET VERSION_LESS 10.6) - message(FATAL_ERROR "Minimun OS X deployment target is 10.6, please update CMAKE_OSX_DEPLOYMENT_TARGET.") + CMAKE_OSX_DEPLOYMENT_TARGET VERSION_LESS 10.7) + message(FATAL_ERROR "Minimun OS X deployment target is 10.7, please update CMAKE_OSX_DEPLOYMENT_TARGET.") endif () endif() diff --git a/README.md b/README.md index ebdfe14df1..e57564636d 100644 --- a/README.md +++ b/README.md @@ -71,7 +71,7 @@ VTK supports the following compilers: VTK supports the following operating systems: 1. Windows Vista or newer -2. Mac OS X 10.6.8 or newer +2. Mac OS X 10.7 or newer 3. Linux (ex: Ubuntu 12.04 or newer, Debian 4 or newer) Contributing diff --git a/Rendering/LIC/vtkLineIntegralConvolution2D.cxx b/Rendering/LIC/vtkLineIntegralConvolution2D.cxx index 85639b738b..a1e91a9d87 100644 --- a/Rendering/LIC/vtkLineIntegralConvolution2D.cxx +++ b/Rendering/LIC/vtkLineIntegralConvolution2D.cxx @@ -1050,17 +1050,8 @@ bool vtkLineIntegralConvolution2D::IsSupported(vtkRenderWindow *renWin) return false; } -#if defined(__APPLE__) || defined(_WIN32) - vtkOpenGLExtensionManager *manager = context->GetExtensionManager(); -#endif -#if defined(__APPLE__) - if (manager->DriverIsNvidia() && manager->DriverVersionIs(1,6)) - { - // Mac OS X 10.6 GLSL doesn't support array initializer - return false; - } -#endif #if defined(_WIN32) + vtkOpenGLExtensionManager *manager = context->GetExtensionManager(); if ( manager->DriverIsIntel() && manager->DriverGLRendererHas("HD Graphics") && !manager->GetIgnoreDriverBugs("Intel HD 2k,3k,4k incorrect results") ) { diff --git a/Rendering/OpenGL/vtkCocoaGLView.mm b/Rendering/OpenGL/vtkCocoaGLView.mm index 73763423cf..2601ab229d 100644 --- a/Rendering/OpenGL/vtkCocoaGLView.mm +++ b/Rendering/OpenGL/vtkCocoaGLView.mm @@ -202,11 +202,7 @@ static const char *vtkMacKeyCodeToKeySymTable[128] = { // first responder. NSPoint windowLoc = [[self window] mouseLocationOutsideOfEventStream]; NSPoint viewLoc = [self convertPoint:windowLoc fromView:nil]; -#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 NSPoint backingLoc = [self convertPointToBacking:viewLoc]; -#else - NSPoint backingLoc = viewLoc; -#endif NSUInteger flags = [theEvent modifierFlags]; int shiftDown = ((flags & NSEventModifierFlagShift) != 0); @@ -306,11 +302,7 @@ static const char *vtkMacKeyCodeToKeySymTable[128] = { // left corner. Since this is a mouse event, we can use locationInWindow. NSPoint windowLoc = [theEvent locationInWindow]; NSPoint viewLoc = [self convertPoint:windowLoc fromView:nil]; -#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 NSPoint backingLoc = [self convertPointToBacking:viewLoc]; -#else - NSPoint backingLoc = viewLoc; -#endif NSUInteger flags = [theEvent modifierFlags]; int shiftDown = ((flags & NSEventModifierFlagShift) != 0); @@ -342,11 +334,7 @@ static const char *vtkMacKeyCodeToKeySymTable[128] = { // left corner. Since this is a mouse event, we can use locationInWindow. NSPoint windowLoc = [theEvent locationInWindow]; NSPoint viewLoc = [self convertPoint:windowLoc fromView:nil]; -#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 NSPoint backingLoc = [self convertPointToBacking:viewLoc]; -#else - NSPoint backingLoc = viewLoc; -#endif int clickCount = static_cast<int>([theEvent clickCount]); int repeatCount = ((clickCount > 1) ? clickCount - 1 : 0); diff --git a/Rendering/OpenGL/vtkCocoaMacOSXSDKCompatibility.h b/Rendering/OpenGL/vtkCocoaMacOSXSDKCompatibility.h index caca0ff5e3..67ce655d90 100644 --- a/Rendering/OpenGL/vtkCocoaMacOSXSDKCompatibility.h +++ b/Rendering/OpenGL/vtkCocoaMacOSXSDKCompatibility.h @@ -16,7 +16,7 @@ PURPOSE. See the above copyright notice for more information. * @class vtkCocoaMacOSXSDKCompatibility * @brief Compatibility header * - * VTK requires the Mac OS X 10.6 SDK or later. + * VTK requires the Mac OS X 10.7 SDK or later. * However, this file is meant to allow us to use features from newer * SDKs by adding workarounds to still support the minimum SDK. * It is safe to include this header multiple times. @@ -24,17 +24,12 @@ PURPOSE. See the above copyright notice for more information. #include <AvailabilityMacros.h> -#if MAC_OS_X_VERSION_MAX_ALLOWED < 1060 - #error VTK requires the Mac OS X 10.6 SDK or later +#if MAC_OS_X_VERSION_MAX_ALLOWED < 1070 + #error VTK requires the Mac OS X 10.7 SDK or later #endif -#if MAC_OS_X_VERSION_MIN_REQUIRED < 1068 - #error VTK requires a deployment target of Mac OS X 10.6.8 or later -#endif - -// __has_feature is new in the 10.7 SDK, define it here if it's not yet defined. -#ifndef __has_feature - #define __has_feature(x) 0 +#if MAC_OS_X_VERSION_MIN_REQUIRED < 1070 + #error VTK requires a deployment target of Mac OS X 10.7 or later #endif #if (MAC_OS_X_VERSION_MAX_ALLOWED < 101200) && !defined(VTK_DONT_MAP_10_12_ENUMS) diff --git a/Rendering/OpenGL/vtkCocoaRenderWindow.h b/Rendering/OpenGL/vtkCocoaRenderWindow.h index ef21bf6ec8..49f8487d66 100644 --- a/Rendering/OpenGL/vtkCocoaRenderWindow.h +++ b/Rendering/OpenGL/vtkCocoaRenderWindow.h @@ -18,8 +18,7 @@ PURPOSE. See the above copyright notice for more information. * * * vtkCocoaRenderWindow is a concrete implementation of the abstract - * class vtkOpenGLRenderWindow. It is only available on Mac OS X 10.6 - * and later. + * class vtkOpenGLRenderWindow. It is only available on Mac OS X. * To use this class, build VTK with VTK_USE_COCOA turned ON (this is * the default). * This class can be used by 32 and 64 bit processes, and either in diff --git a/Rendering/OpenGL/vtkCocoaRenderWindow.mm b/Rendering/OpenGL/vtkCocoaRenderWindow.mm index d986e6d511..d0cb78ff0d 100644 --- a/Rendering/OpenGL/vtkCocoaRenderWindow.mm +++ b/Rendering/OpenGL/vtkCocoaRenderWindow.mm @@ -181,11 +181,7 @@ vtkStandardNewMacro(vtkCocoaRenderWindow); NSRect viewRect = [view frame]; // Convert from points to pixels. -#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 NSRect backingViewRect = [view convertRectToBacking:viewRect]; -#else - NSRect backingViewRect = viewRect; -#endif int newWidth = static_cast<int>(NSWidth(backingViewRect)); int newHeight = static_cast<int>(NSHeight(backingViewRect)); @@ -546,11 +542,7 @@ void vtkCocoaRenderWindow::SetSize(int x, int y) // Convert the given new size from pixels to points. NSSize backingNewSize = NSMakeSize((CGFloat)x, (CGFloat)y); -#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 NSSize newSize = [theView convertSizeFromBacking:backingNewSize]; -#else - NSSize newSize = backingNewSize; -#endif // Update the view's frame (in points) keeping the bottom-left // corner in the same place. @@ -574,11 +566,7 @@ void vtkCocoaRenderWindow::SetSize(int x, int y) // Convert the given new size from pixels to points. NSRect backingNewRect = NSMakeRect(0.0, 0.0, (CGFloat)x, (CGFloat)y); -#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 NSRect newRect = [window convertRectFromBacking:backingNewRect]; -#else - NSRect newRect = backingNewRect; -#endif [window setContentSize:newRect.size]; resizing = false; @@ -626,11 +614,7 @@ void vtkCocoaRenderWindow::SetPosition(int x, int y) // Convert the given new position from pixels to points. NSPoint backingNewPosition = NSMakePoint((CGFloat)x, (CGFloat)y); -#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 NSPoint newPosition = [theView convertPointFromBacking:backingNewPosition]; -#else - NSPoint newPosition = backingNewPosition; -#endif // Update the view's frameOrigin (in points) keeping the bottom-left // corner in the same place. @@ -655,11 +639,7 @@ void vtkCocoaRenderWindow::SetPosition(int x, int y) // Convert the given new position from pixels to points. NSRect backingNewPosition = NSMakeRect(0.0, 0.0, (CGFloat)x, (CGFloat)y); -#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 NSRect newPosition = [window convertRectFromBacking:backingNewPosition]; -#else - NSRect newPosition = backingNewPosition; -#endif [window setFrameOrigin:newPosition.origin]; @@ -804,11 +784,7 @@ void vtkCocoaRenderWindow::CreateAWindow() NSRect screenRect = [screen frame]; // Convert from points to pixels. -#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 NSRect backingScreenRect = [screen convertRectToBacking:screenRect]; -#else - NSRect backingScreenRect = screenRect; -#endif if (this->FullScreen && screen) { @@ -847,7 +823,6 @@ void vtkCocoaRenderWindow::CreateAWindow() // Convert from pixels to points. NSRect contentRect; -#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 if (screen) { contentRect = [screen convertRectFromBacking:backingContentRect]; @@ -856,9 +831,6 @@ void vtkCocoaRenderWindow::CreateAWindow() { contentRect = backingContentRect; } -#else - contentRect = backingContentRect; -#endif theWindow = [[NSWindow alloc] initWithContentRect:contentRect @@ -906,11 +878,7 @@ void vtkCocoaRenderWindow::CreateAWindow() (CGFloat)this->Position[1], (CGFloat)this->Size[0], (CGFloat)this->Size[1]); -#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 NSRect viewRect = [window convertRectFromBacking:backingViewRect]; -#else - NSRect viewRect = backingViewRect; -#endif CGFloat width = NSWidth(viewRect); CGFloat height = NSHeight(viewRect); @@ -946,11 +914,7 @@ void vtkCocoaRenderWindow::CreateAWindow() // Convert from points to pixels. NSWindow *window = (NSWindow*)this->GetRootWindow(); assert(window); -#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 NSRect viewRect = [window convertRectFromBacking:backingViewRect]; -#else - NSRect viewRect = backingViewRect; -#endif // Create a vtkCocoaGLView. vtkCocoaGLView *glView = [[vtkCocoaGLView alloc] initWithFrame:viewRect]; @@ -1172,11 +1136,7 @@ int *vtkCocoaRenderWindow::GetSize() NSRect viewRect = [view frame]; // Convert from points to pixels. -#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 NSRect backingViewRect = [view convertRectToBacking:viewRect]; -#else - NSRect backingViewRect = viewRect; -#endif this->Size[0] = static_cast<int>(NSWidth(backingViewRect)); this->Size[1] = static_cast<int>(NSHeight(backingViewRect)); @@ -1197,11 +1157,7 @@ int *vtkCocoaRenderWindow::GetScreenSize() NSRect screenRect = [screen frame]; // Convert from points to pixels. -#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 NSRect backingScreenRect = [screen convertRectToBacking:screenRect]; -#else - NSRect backingScreenRect = screenRect; -#endif this->Size[0] = static_cast<int>(NSWidth(backingScreenRect)); this->Size[1] = static_cast<int>(NSHeight(backingScreenRect)); @@ -1228,13 +1184,8 @@ int *vtkCocoaRenderWindow::GetPosition() NSRect viewRect = [view frame]; // Convert from points to pixels. -#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 NSRect backingParentRect = [parent convertRectToBacking:parentRect]; NSRect backingViewRect = [view convertRectToBacking:viewRect]; -#else - NSRect backingParentRect = parentRect; - NSRect backingViewRect = viewRect; -#endif this->Position[0] = static_cast<int>(NSMinX(backingViewRect)); this->Position[1] = static_cast<int>(NSHeight(backingParentRect) @@ -1254,11 +1205,7 @@ int *vtkCocoaRenderWindow::GetPosition() NSRect windowRect = [window frame]; // Convert from points to pixels. -#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 NSRect backingWindowRect = [window convertRectToBacking:windowRect]; -#else - NSRect backingWindowRect = windowRect; -#endif this->Position[0] = static_cast<int>(NSMinX(backingWindowRect)); this->Position[1] = static_cast<int>(NSMinY(backingWindowRect)); diff --git a/Rendering/OpenGL/vtkCoreGraphicsGPUInfoList.cxx b/Rendering/OpenGL/vtkCoreGraphicsGPUInfoList.cxx index 826988ab97..251b4bf7ff 100644 --- a/Rendering/OpenGL/vtkCoreGraphicsGPUInfoList.cxx +++ b/Rendering/OpenGL/vtkCoreGraphicsGPUInfoList.cxx @@ -49,13 +49,8 @@ void vtkCoreGraphicsGPUInfoList::Probe() { GLint vramGL = 0; vtkTypeUInt64 vramVTK = 0; -#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 error = CGLDescribeRenderer(infoObj, i, kCGLRPVideoMemoryMegabytes, &vramGL); vramVTK = static_cast<vtkTypeUInt64>(vramGL) * 1024 * 1024; -#else - error = CGLDescribeRenderer(infoObj, i, kCGLRPVideoMemory, &vramGL); - vramVTK = static_cast<vtkTypeUInt64>(vramGL); -#endif // The software renderer will return a video memory of 0, so ignore it. if ((error == kCGLNoError) && (vramVTK > 0)) diff --git a/Rendering/OpenGL2/vtkCocoaGLView.mm b/Rendering/OpenGL2/vtkCocoaGLView.mm index 73763423cf..2601ab229d 100644 --- a/Rendering/OpenGL2/vtkCocoaGLView.mm +++ b/Rendering/OpenGL2/vtkCocoaGLView.mm @@ -202,11 +202,7 @@ static const char *vtkMacKeyCodeToKeySymTable[128] = { // first responder. NSPoint windowLoc = [[self window] mouseLocationOutsideOfEventStream]; NSPoint viewLoc = [self convertPoint:windowLoc fromView:nil]; -#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 NSPoint backingLoc = [self convertPointToBacking:viewLoc]; -#else - NSPoint backingLoc = viewLoc; -#endif NSUInteger flags = [theEvent modifierFlags]; int shiftDown = ((flags & NSEventModifierFlagShift) != 0); @@ -306,11 +302,7 @@ static const char *vtkMacKeyCodeToKeySymTable[128] = { // left corner. Since this is a mouse event, we can use locationInWindow. NSPoint windowLoc = [theEvent locationInWindow]; NSPoint viewLoc = [self convertPoint:windowLoc fromView:nil]; -#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 NSPoint backingLoc = [self convertPointToBacking:viewLoc]; -#else - NSPoint backingLoc = viewLoc; -#endif NSUInteger flags = [theEvent modifierFlags]; int shiftDown = ((flags & NSEventModifierFlagShift) != 0); @@ -342,11 +334,7 @@ static const char *vtkMacKeyCodeToKeySymTable[128] = { // left corner. Since this is a mouse event, we can use locationInWindow. NSPoint windowLoc = [theEvent locationInWindow]; NSPoint viewLoc = [self convertPoint:windowLoc fromView:nil]; -#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 NSPoint backingLoc = [self convertPointToBacking:viewLoc]; -#else - NSPoint backingLoc = viewLoc; -#endif int clickCount = static_cast<int>([theEvent clickCount]); int repeatCount = ((clickCount > 1) ? clickCount - 1 : 0); diff --git a/Rendering/OpenGL2/vtkCocoaMacOSXSDKCompatibility.h b/Rendering/OpenGL2/vtkCocoaMacOSXSDKCompatibility.h index caca0ff5e3..67ce655d90 100644 --- a/Rendering/OpenGL2/vtkCocoaMacOSXSDKCompatibility.h +++ b/Rendering/OpenGL2/vtkCocoaMacOSXSDKCompatibility.h @@ -16,7 +16,7 @@ PURPOSE. See the above copyright notice for more information. * @class vtkCocoaMacOSXSDKCompatibility * @brief Compatibility header * - * VTK requires the Mac OS X 10.6 SDK or later. + * VTK requires the Mac OS X 10.7 SDK or later. * However, this file is meant to allow us to use features from newer * SDKs by adding workarounds to still support the minimum SDK. * It is safe to include this header multiple times. @@ -24,17 +24,12 @@ PURPOSE. See the above copyright notice for more information. #include <AvailabilityMacros.h> -#if MAC_OS_X_VERSION_MAX_ALLOWED < 1060 - #error VTK requires the Mac OS X 10.6 SDK or later +#if MAC_OS_X_VERSION_MAX_ALLOWED < 1070 + #error VTK requires the Mac OS X 10.7 SDK or later #endif -#if MAC_OS_X_VERSION_MIN_REQUIRED < 1068 - #error VTK requires a deployment target of Mac OS X 10.6.8 or later -#endif - -// __has_feature is new in the 10.7 SDK, define it here if it's not yet defined. -#ifndef __has_feature - #define __has_feature(x) 0 +#if MAC_OS_X_VERSION_MIN_REQUIRED < 1070 + #error VTK requires a deployment target of Mac OS X 10.7 or later #endif #if (MAC_OS_X_VERSION_MAX_ALLOWED < 101200) && !defined(VTK_DONT_MAP_10_12_ENUMS) diff --git a/Rendering/OpenGL2/vtkCocoaRenderWindow.h b/Rendering/OpenGL2/vtkCocoaRenderWindow.h index 42e3a0546b..53d4150dde 100644 --- a/Rendering/OpenGL2/vtkCocoaRenderWindow.h +++ b/Rendering/OpenGL2/vtkCocoaRenderWindow.h @@ -18,8 +18,7 @@ PURPOSE. See the above copyright notice for more information. * * * vtkCocoaRenderWindow is a concrete implementation of the abstract - * class vtkOpenGLRenderWindow. It is only available on Mac OS X 10.6 - * and later. + * class vtkOpenGLRenderWindow. It is only available on Mac OS X. * To use this class, build VTK with VTK_USE_COCOA turned ON (this is * the default). * This class can be used by 32 and 64 bit processes, and either in diff --git a/Rendering/OpenGL2/vtkCocoaRenderWindow.mm b/Rendering/OpenGL2/vtkCocoaRenderWindow.mm index 0bfb57450a..ec03f17ba2 100644 --- a/Rendering/OpenGL2/vtkCocoaRenderWindow.mm +++ b/Rendering/OpenGL2/vtkCocoaRenderWindow.mm @@ -185,11 +185,7 @@ vtkStandardNewMacro(vtkCocoaRenderWindow); NSRect viewRect = [view frame]; // Convert from points to pixels. -#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 NSRect backingViewRect = [view convertRectToBacking:viewRect]; -#else - NSRect backingViewRect = viewRect; -#endif int newWidth = static_cast<int>(NSWidth(backingViewRect)); int newHeight = static_cast<int>(NSHeight(backingViewRect)); @@ -536,11 +532,7 @@ void vtkCocoaRenderWindow::SetSize(int x, int y) // Convert the given new size from pixels to points. NSSize backingNewSize = NSMakeSize((CGFloat)x, (CGFloat)y); -#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 NSSize newSize = [theView convertSizeFromBacking:backingNewSize]; -#else - NSSize newSize = backingNewSize; -#endif // Update the view's frame (in points) keeping the bottom-left // corner in the same place. @@ -564,11 +556,7 @@ void vtkCocoaRenderWindow::SetSize(int x, int y) // Convert the given new size from pixels to points. NSRect backingNewRect = NSMakeRect(0.0, 0.0, (CGFloat)x, (CGFloat)y); -#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 NSRect newRect = [window convertRectFromBacking:backingNewRect]; -#else - NSRect newRect = backingNewRect; -#endif [window setContentSize:newRect.size]; resizing = false; @@ -616,11 +604,7 @@ void vtkCocoaRenderWindow::SetPosition(int x, int y) // Convert the given new position from pixels to points. NSPoint backingNewPosition = NSMakePoint((CGFloat)x, (CGFloat)y); -#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 NSPoint newPosition = [theView convertPointFromBacking:backingNewPosition]; -#else - NSPoint newPosition = backingNewPosition; -#endif // Update the view's frameOrigin (in points) keeping the bottom-left // corner in the same place. @@ -645,11 +629,7 @@ void vtkCocoaRenderWindow::SetPosition(int x, int y) // Convert the given new position from pixels to points. NSRect backingNewPosition = NSMakeRect(0.0, 0.0, (CGFloat)x, (CGFloat)y); -#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 NSRect newPosition = [window convertRectFromBacking:backingNewPosition]; -#else - NSRect newPosition = backingNewPosition; -#endif [window setFrameOrigin:newPosition.origin]; @@ -791,11 +771,7 @@ void vtkCocoaRenderWindow::CreateAWindow() NSRect screenRect = [screen frame]; // Convert from points to pixels. -#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 NSRect backingScreenRect = [screen convertRectToBacking:screenRect]; -#else - NSRect backingScreenRect = screenRect; -#endif if (this->FullScreen && screen) { @@ -834,7 +810,6 @@ void vtkCocoaRenderWindow::CreateAWindow() // Convert from pixels to points. NSRect contentRect; -#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 if (screen) { contentRect = [screen convertRectFromBacking:backingContentRect]; @@ -843,9 +818,6 @@ void vtkCocoaRenderWindow::CreateAWindow() { contentRect = backingContentRect; } -#else - contentRect = backingContentRect; -#endif theWindow = [[NSWindow alloc] initWithContentRect:contentRect @@ -893,11 +865,7 @@ void vtkCocoaRenderWindow::CreateAWindow() (CGFloat)this->Position[1], (CGFloat)this->Size[0], (CGFloat)this->Size[1]); -#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 NSRect viewRect = [window convertRectFromBacking:backingViewRect]; -#else - NSRect viewRect = backingViewRect; -#endif CGFloat width = NSWidth(viewRect); CGFloat height = NSHeight(viewRect); @@ -933,11 +901,7 @@ void vtkCocoaRenderWindow::CreateAWindow() // Convert from points to pixels. NSWindow *window = (NSWindow*)this->GetRootWindow(); assert(window); -#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 NSRect viewRect = [window convertRectFromBacking:backingViewRect]; -#else - NSRect viewRect = backingViewRect; -#endif // Create a vtkCocoaGLView. vtkCocoaGLView *glView = [[vtkCocoaGLView alloc] initWithFrame:viewRect]; @@ -1003,10 +967,9 @@ void vtkCocoaRenderWindow::CreateGLContext() int i = 0; NSOpenGLPixelFormatAttribute attribs[20]; -#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 attribs[i++] = NSOpenGLPFAOpenGLProfile; attribs[i++] = NSOpenGLProfileVersion3_2Core; -#endif + // OS X always prefers an accelerated context // attribs[i++] = NSOpenGLPFAAccelerated; attribs[i++] = NSOpenGLPFADepthSize; @@ -1058,11 +1021,7 @@ void vtkCocoaRenderWindow::CreateGLContext() } else { -#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 this->SetContextSupportsOpenGL32(true); -#else - this->SetContextSupportsOpenGL32(false); -#endif } } @@ -1172,11 +1131,7 @@ int *vtkCocoaRenderWindow::GetSize() NSRect viewRect = [view frame]; // Convert from points to pixels. -#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 NSRect backingViewRect = [view convertRectToBacking:viewRect]; -#else - NSRect backingViewRect = viewRect; -#endif this->Size[0] = static_cast<int>(NSWidth(backingViewRect)); this->Size[1] = static_cast<int>(NSHeight(backingViewRect)); @@ -1197,11 +1152,7 @@ int *vtkCocoaRenderWindow::GetScreenSize() NSRect screenRect = [screen frame]; // Convert from points to pixels. -#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 NSRect backingScreenRect = [screen convertRectToBacking:screenRect]; -#else - NSRect backingScreenRect = screenRect; -#endif this->Size[0] = static_cast<int>(NSWidth(backingScreenRect)); this->Size[1] = static_cast<int>(NSHeight(backingScreenRect)); @@ -1228,13 +1179,8 @@ int *vtkCocoaRenderWindow::GetPosition() NSRect viewRect = [view frame]; // Convert from points to pixels. -#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 NSRect backingParentRect = [parent convertRectToBacking:parentRect]; NSRect backingViewRect = [view convertRectToBacking:viewRect]; -#else - NSRect backingParentRect = parentRect; - NSRect backingViewRect = viewRect; -#endif this->Position[0] = static_cast<int>(NSMinX(backingViewRect)); this->Position[1] = static_cast<int>(NSHeight(backingParentRect) @@ -1254,11 +1200,7 @@ int *vtkCocoaRenderWindow::GetPosition() NSRect windowRect = [window frame]; // Convert from points to pixels. -#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 NSRect backingWindowRect = [window convertRectToBacking:windowRect]; -#else - NSRect backingWindowRect = windowRect; -#endif this->Position[0] = static_cast<int>(NSMinX(backingWindowRect)); this->Position[1] = static_cast<int>(NSMinY(backingWindowRect)); diff --git a/Rendering/OpenGL2/vtkIOSRenderWindow.h b/Rendering/OpenGL2/vtkIOSRenderWindow.h index c79550ddc9..be5168174a 100644 --- a/Rendering/OpenGL2/vtkIOSRenderWindow.h +++ b/Rendering/OpenGL2/vtkIOSRenderWindow.h @@ -18,8 +18,7 @@ PURPOSE. See the above copyright notice for more information. * * * vtkIOSRenderWindow is a concrete implementation of the abstract - * class vtkOpenGLRenderWindow. It is only available on Mac OS X 10.6 - * and later. + * class vtkOpenGLRenderWindow. It is only available on iOS. * To use this class, build VTK with VTK_USE_IOS turned ON (this is * the default). * This class can be used by 32 and 64 bit processes, and either in diff --git a/Rendering/VolumeOpenGL/vtkOpenGLGPUVolumeRayCastMapper.cxx b/Rendering/VolumeOpenGL/vtkOpenGLGPUVolumeRayCastMapper.cxx index 8cb30f5f87..81c8b81e1c 100644 --- a/Rendering/VolumeOpenGL/vtkOpenGLGPUVolumeRayCastMapper.cxx +++ b/Rendering/VolumeOpenGL/vtkOpenGLGPUVolumeRayCastMapper.cxx @@ -2192,27 +2192,6 @@ void vtkOpenGLGPUVolumeRayCastMapper::LoadExtensions( } vtkOpenGLExtensionManager *extensions = context->GetExtensionManager(); - // It does not work on Mac OS X 10.6 (Snow Leopard) with nVidia. - // There is a bug in that OpenGL driver with an error in the - // Cg compiler about an infinite loop. - // However it works with Mac OS X 10.7 (Lion) with nVidia. -#if defined(__APPLE__) && (MAC_OS_X_VERSION_MIN_REQUIRED < 1070) - // Gestalt() is deprecated, but all this code will go away when 10.7 is VTK's minimum. - #pragma clang diagnostic push - #pragma clang diagnostic ignored "-Wdeprecated-declarations" - SInt32 major, minor; - Gestalt (gestaltSystemVersionMajor, &major); - Gestalt (gestaltSystemVersionMinor, &minor); - #pragma clang diagnostic pop - if (extensions->DriverIsNvidia() && (major == 10) && (minor == 6)) - { - this->UnsupportedRequiredExtensions->Stream << - " Disabled on unsupported Apple OS X driver."; - this->LoadExtensionsSucceeded=0; - return; - } -#endif - // mesa notes: // 8.0.0 -- missing some required extensions // 8.0.5 -- tests pass but there are invalid enum opengl errors reported (mesa bug) -- GitLab