use NSOpenGLPFAAllowOfflineRenderers for GC bitmap
Try to tell Macs with two graphics cards that it's ok to
use the low-performance one for the GC bitmap (when
GL is used for that, which is OS X 10.11 and later).
(cherry picked from commit 345a20c5e8
)
This commit is contained in:
parent
166b03c69d
commit
0d7aea319f
|
@ -208,12 +208,13 @@
|
||||||
(define NSOpenGLPFASampleBuffers 55)
|
(define NSOpenGLPFASampleBuffers 55)
|
||||||
(define NSOpenGLPFASamples 56)
|
(define NSOpenGLPFASamples 56)
|
||||||
(define NSOpenGLPFAMultisample 59)
|
(define NSOpenGLPFAMultisample 59)
|
||||||
|
(define NSOpenGLPFAAllowOfflineRenderers 96)
|
||||||
(define NSOpenGLPFAOpenGLProfile 99)
|
(define NSOpenGLPFAOpenGLProfile 99)
|
||||||
|
|
||||||
(define NSOpenGLProfileVersionLegacy #x1000)
|
(define NSOpenGLProfileVersionLegacy #x1000)
|
||||||
(define NSOpenGLProfileVersion3_2Core #x3200)
|
(define NSOpenGLProfileVersion3_2Core #x3200)
|
||||||
|
|
||||||
(define (gl-config->pixel-format conf)
|
(define (gl-config->pixel-format conf allow-offline?)
|
||||||
(let ([conf (or conf (new gl-config%))])
|
(let ([conf (or conf (new gl-config%))])
|
||||||
(tell (tell NSOpenGLPixelFormat alloc)
|
(tell (tell NSOpenGLPixelFormat alloc)
|
||||||
initWithAttributes: #:type (_list i _int)
|
initWithAttributes: #:type (_list i _int)
|
||||||
|
@ -224,6 +225,9 @@
|
||||||
NSOpenGLProfileVersionLegacy
|
NSOpenGLProfileVersionLegacy
|
||||||
NSOpenGLProfileVersion3_2Core))
|
NSOpenGLProfileVersion3_2Core))
|
||||||
null)
|
null)
|
||||||
|
(if allow-offline?
|
||||||
|
(list NSOpenGLPFAAllowOfflineRenderers)
|
||||||
|
null)
|
||||||
(if (send conf get-double-buffered) (list NSOpenGLPFADoubleBuffer) null)
|
(if (send conf get-double-buffered) (list NSOpenGLPFADoubleBuffer) null)
|
||||||
(if (send conf get-stereo) (list NSOpenGLPFAStereo) null)
|
(if (send conf get-stereo) (list NSOpenGLPFAStereo) null)
|
||||||
(list
|
(list
|
||||||
|
@ -427,7 +431,7 @@
|
||||||
initWithFrame: #:type _NSRect r)
|
initWithFrame: #:type _NSRect r)
|
||||||
(let* ([share-context (and gl-config (send gl-config get-share-context))]
|
(let* ([share-context (and gl-config (send gl-config get-share-context))]
|
||||||
[context-handle (and share-context (send share-context get-handle))]
|
[context-handle (and share-context (send share-context get-handle))]
|
||||||
[pf (gl-config->pixel-format gl-config)]
|
[pf (gl-config->pixel-format gl-config #f)]
|
||||||
[new-context (and
|
[new-context (and
|
||||||
context-handle
|
context-handle
|
||||||
(tell (tell NSOpenGLContext alloc)
|
(tell (tell NSOpenGLContext alloc)
|
||||||
|
@ -955,7 +959,7 @@
|
||||||
backing: #:type _int NSBackingStoreBuffered
|
backing: #:type _int NSBackingStoreBuffered
|
||||||
defer: #:type _BOOL NO))]
|
defer: #:type _BOOL NO))]
|
||||||
[glv (and gc-via-gl?
|
[glv (and gc-via-gl?
|
||||||
(let ([pf (gl-config->pixel-format #f)])
|
(let ([pf (gl-config->pixel-format #f #t)])
|
||||||
(begin0
|
(begin0
|
||||||
(tell (tell RacketGCGLView alloc)
|
(tell (tell RacketGCGLView alloc)
|
||||||
initWithFrame: #:type _NSRect (make-NSRect (make-NSPoint 0 0)
|
initWithFrame: #:type _NSRect (make-NSRect (make-NSPoint 0 0)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user