Index: content/browser/renderer_host/compositing_iosurface_mac.mm |
diff --git a/content/browser/renderer_host/compositing_iosurface_mac.mm b/content/browser/renderer_host/compositing_iosurface_mac.mm |
index 589fb7fa82b505e6ccfa902ef557785f81de055e..2d446ee70a79a3b69016330a831836bf3bc1f8f0 100644 |
--- a/content/browser/renderer_host/compositing_iosurface_mac.mm |
+++ b/content/browser/renderer_host/compositing_iosurface_mac.mm |
@@ -167,7 +167,8 @@ CompositingIOSurfaceMac::CopyContext::CopyContext() { |
CompositingIOSurfaceMac::CopyContext::~CopyContext() { |
} |
-CompositingIOSurfaceMac* CompositingIOSurfaceMac::Create() { |
+// static |
+CompositingIOSurfaceMac* CompositingIOSurfaceMac::Create(bool below_window) { |
TRACE_EVENT0("browser", "CompositingIOSurfaceMac::Create"); |
IOSurfaceSupport* io_surface_support = IOSurfaceSupport::Initialize(); |
if (!io_surface_support) { |
@@ -198,10 +199,13 @@ CompositingIOSurfaceMac* CompositingIOSurfaceMac::Create() { |
return NULL; |
} |
- // We "punch a hole" in the window, and have the WindowServer render the |
- // OpenGL surface underneath so we can draw over it. |
- GLint belowWindow = -1; |
- [glContext setValues:&belowWindow forParameter:NSOpenGLCPSurfaceOrder]; |
+ // If requested, ask the WindowServer to render the OpenGL surface underneath |
+ // the window. This, combined with a hole punched in the window, will allow |
+ // for views to "overlap" the GL surface from the user's point of view. |
+ if (below_window) { |
+ GLint belowWindow = -1; |
+ [glContext setValues:&belowWindow forParameter:NSOpenGLCPSurfaceOrder]; |
+ } |
CGLContextObj cglContext = (CGLContextObj)[glContext CGLContextObj]; |
if (!cglContext) { |