Cast: Stop logging kVideoFrameSentToEncoder and rename a couple events.
[chromium-blink-merge.git] / content / browser / renderer_host / compositing_iosurface_layer_mac.h
blob115f62b9d52504cde7cdb4968fb12cbc5baa785d
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"
13 namespace content {
14 class CompositingIOSurfaceContext;
15 class RenderWidgetHostViewMac;
18 // The CoreAnimation layer for drawing accelerated content.
19 @interface CompositingIOSurfaceLayer : CAOpenGLLayer {
20 @private
21 content::RenderWidgetHostViewMac* renderWidgetHostView_;
22 scoped_refptr<content::CompositingIOSurfaceContext> context_;
24 // Used to track when canDrawInCGLContext should return YES. This can be
25 // in response to receiving a new compositor frame, or from any of the events
26 // that cause setNeedsDisplay to be called on the layer.
27 BOOL needsDisplay_;
30 - (id)initWithRenderWidgetHostViewMac:(content::RenderWidgetHostViewMac*)r;
32 // Remove this layer from the layer heirarchy, and mark that
33 // |renderWidgetHostView_| is no longer valid and may no longer be dereferenced.
34 - (void)disableCompositing;
36 // Called when a new frame is received.
37 - (void)gotNewFrame;
39 // Called when it has been a while since a new frame has been received, and the
40 // layer should become not-asynchronous.
41 - (void)timerSinceGotNewFrameFired;
43 @end
45 #endif // CONTENT_BROWSER_RENDERER_HOST_COMPOSITING_IOSURFACE_LAYER_MAC_H_