Changeset 846 for trunk/src/opengl/qgl_mac.mm
- Timestamp:
- May 5, 2011, 5:36:53 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.7.2 (added) merged: 845 /branches/vendor/nokia/qt/current merged: 844 /branches/vendor/nokia/qt/4.6.3 removed
- Property svn:mergeinfo changed
-
trunk/src/opengl/qgl_mac.mm
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 201 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation ([email protected]) … … 698 698 NSView *view = qt_mac_nativeview_for(w); 699 699 700 // ideally we would use QWidget::isVisible(), but we get "invalid drawable" errors 701 if (![(NSWindow *)qt_mac_window_for(w) isVisible]) 702 return; 700 // Trying to attach the GL context to the NSView will fail with 701 // "invalid drawable" if done too soon, but we have to make sure 702 // the connection is made before the first paint event. Using 703 // the NSView do to this check fails as the NSView is visible 704 // before it's safe to connect, and using the NSWindow fails as 705 // the NSWindow will become visible after the first paint event. 706 // This leaves us with the QWidget, who's visible state seems 707 // to match the point in time when it's safe to connect. 708 if (!w || !w->isVisible()) 709 return; // Not safe to attach GL context to view yet 710 703 711 if ([static_cast<NSOpenGLContext *>(d->cx) view] != view && ![view isHidden]) 704 712 [static_cast<NSOpenGLContext *>(d->cx) setView:view]; … … 805 813 { 806 814 CFBundleRef bundle = 0; 815 807 816 QCFType<CFURLRef> url = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, 808 QCFString::toCFStringRef(QLatin1String("/System/Library/Frameworks/OpenGL.framework")), kCFURLPOSIXPathStyle, false);817 , kCFURLPOSIXPathStyle, false); 809 818 if (url) 810 819 bundle = CFBundleCreate(kCFAllocatorDefault, url); 820 811 821 return bundle; 812 822 } … … 814 824 void *QGLContext::getProcAddress(const QString &proc) const 815 825 { 816 return CFBundleGetFunctionPointerForName(QCFType<CFBundleRef>(qt_getOpenGLBundle()), 817 QCFString(proc)); 826 CFStringRef procName = QCFString(proc).toCFStringRef(proc); 827 void *result = CFBundleGetFunctionPointerForName(QCFType<CFBundleRef>(qt_getOpenGLBundle()), 828 procName); 829 CFRelease(procName); 830 return result; 818 831 } 819 832 #ifndef QT_MAC_USE_COCOA
Note:
See TracChangeset
for help on using the changeset viewer.