Bug 676248 - Make the window GL context transparent on OSX. r=bgirard
authorMarkus Stange <mstange@themasta.com>
Mon, 11 Mar 2013 12:29:00 -0400
changeset 124378 635e926d9e4f1f3b9ecd32009feea56c8ea0cf53
parent 124377 cecc73dc627aa6c553a067063f5820010197d74d
child 124379 64bdaa6a86cdbeb965446a2a109ea5beca4d0b0f
push id24417
push userryanvm@gmail.com
push dateMon, 11 Mar 2013 23:58:07 +0000
treeherdermozilla-central@7433bc4545c9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbgirard
bugs676248
milestone22.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 676248 - Make the window GL context transparent on OSX. r=bgirard
gfx/gl/GLContextProviderCGL.mm
--- a/gfx/gl/GLContextProviderCGL.mm
+++ b/gfx/gl/GLContextProviderCGL.mm
@@ -317,24 +317,27 @@ already_AddRefed<GLContext>
 GLContextProviderCGL::CreateForWindow(nsIWidget *aWidget)
 {
     if (!sCGLLibrary.EnsureInitialized()) {
         return nullptr;
     }
 
     GLContextCGL *shareContext = GetGlobalContextCGL();
 
-    NSOpenGLContext *context = [[NSOpenGLContext alloc] 
+    NSOpenGLContext *context = [[NSOpenGLContext alloc]
                                 initWithFormat:sCGLLibrary.PixelFormat()
                                 shareContext:(shareContext ? shareContext->mContext : NULL)];
     if (!context) {
         return nullptr;
     }
 
     // make the context transparent
+    GLint opaque = 0;
+    [context setValues:&opaque forParameter:NSOpenGLCPSurfaceOpacity];
+
     SurfaceCaps caps = SurfaceCaps::ForRGBA();
     nsRefPtr<GLContextCGL> glContext = new GLContextCGL(caps,
                                                         shareContext,
                                                         context);
     if (!glContext->Init()) {
         return nullptr;
     }