| Index: ui/base/cocoa/underlay_opengl_hosting_window.mm
|
| diff --git a/ui/base/cocoa/underlay_opengl_hosting_window.mm b/ui/base/cocoa/underlay_opengl_hosting_window.mm
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..95f36af0476b239db0318c4b15cec907344143ea
|
| --- /dev/null
|
| +++ b/ui/base/cocoa/underlay_opengl_hosting_window.mm
|
| @@ -0,0 +1,29 @@
|
| +// Copyright (c) 2012 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#import "ui/base/cocoa/underlay_opengl_hosting_window.h"
|
| +
|
| +#include "base/logging.h"
|
| +
|
| +@implementation UnderlayOpenGLHostingWindow
|
| +
|
| +- (void)underlaySurfaceAdded {
|
| + DCHECK_GE(underlaySurfaceCount_, 0);
|
| + ++underlaySurfaceCount_;
|
| +
|
| + // We're having the OpenGL surface render under the window, so the window
|
| + // needs to be not opaque.
|
| + if (underlaySurfaceCount_ == 1)
|
| + [self setOpaque:NO];
|
| +}
|
| +
|
| +- (void)underlaySurfaceRemoved {
|
| + --underlaySurfaceCount_;
|
| + DCHECK_GE(underlaySurfaceCount_, 0);
|
| +
|
| + if (underlaySurfaceCount_ == 0)
|
| + [self setOpaque:YES];
|
| +}
|
| +
|
| +@end
|
|
|