1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CONTENT_BROWSER_RENDERER_HOST_COMPOSITING_IOSURFACE_LAYER_MAC_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_COMPOSITING_IOSURFACE_LAYER_MAC_H_
8 #import <Cocoa/Cocoa.h>
10 #include "base/mac/scoped_cftyperef.h"
11 #include "base/memory/ref_counted.h"
14 class CompositingIOSurfaceContext
;
15 class RenderWidgetHostViewMac
;
18 // The CoreAnimation layer for drawing accelerated content.
19 @interface CompositingIOSurfaceLayer
: CAOpenGLLayer
{
21 content::RenderWidgetHostViewMac
* renderWidgetHostView_
;
22 scoped_refptr
<content::CompositingIOSurfaceContext
> context_
;
25 @
property(nonatomic
, readonly
)
26 scoped_refptr
<content::CompositingIOSurfaceContext
> context
;
28 - (id
)initWithRenderWidgetHostViewMac
:(content::RenderWidgetHostViewMac
*)r
;
30 // Update the scale factor of the layer to match the scale factor of the
32 - (void)updateScaleFactor
;
34 // Remove this layer from the layer heirarchy, and mark that
35 // |renderWidgetHostView_| is no longer valid and may no longer be dereferenced.
36 - (void)disableCompositing
;
40 #endif // CONTENT_BROWSER_RENDERER_HOST_COMPOSITING_IOSURFACE_LAYER_MAC_H_