OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_BROWSER_RENDERER_HOST_COMPOSITING_IOSURFACE_LAYER_MAC_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_COMPOSITING_IOSURFACE_LAYER_MAC_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_COMPOSITING_IOSURFACE_LAYER_MAC_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_COMPOSITING_IOSURFACE_LAYER_MAC_H_ |
7 | 7 |
8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
9 | 9 |
10 #include "base/mac/scoped_cftyperef.h" | 10 #include "base/mac/scoped_cftyperef.h" |
11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
12 #include "base/timer/timer.h" | 12 #include "base/timer/timer.h" |
13 | 13 |
14 namespace content { | 14 namespace content { |
15 class CompositingIOSurfaceMac; | 15 class CompositingIOSurfaceMac; |
16 class CompositingIOSurfaceContext; | 16 class CompositingIOSurfaceContext; |
17 class CompositingIOSurfaceLayerHelper; | 17 class CompositingIOSurfaceLayerHelper; |
18 | 18 |
19 class CompositingIOSurfaceLayerClient { | 19 class CompositingIOSurfaceLayerClient { |
20 public: | 20 public: |
21 virtual void AcceleratedLayerDidDrawFrame(bool succeeded) = 0; | 21 virtual void AcceleratedLayerDidDrawFrame(bool succeeded) = 0; |
22 }; | 22 }; |
23 | 23 |
24 } | 24 } // namespace content |
25 | 25 |
26 // The CoreAnimation layer for drawing accelerated content. | 26 // The CoreAnimation layer for drawing accelerated content. |
27 @interface CompositingIOSurfaceLayer : CAOpenGLLayer { | 27 @interface CompositingIOSurfaceLayer : CAOpenGLLayer { |
28 @private | 28 @private |
29 content::CompositingIOSurfaceLayerClient* client_; | 29 content::CompositingIOSurfaceLayerClient* client_; |
30 scoped_refptr<content::CompositingIOSurfaceMac> iosurface_; | 30 scoped_refptr<content::CompositingIOSurfaceMac> iosurface_; |
31 scoped_refptr<content::CompositingIOSurfaceContext> context_; | 31 scoped_refptr<content::CompositingIOSurfaceContext> context_; |
32 | 32 |
33 // The browser places back-pressure on the GPU by not acknowledging swap | 33 // The browser places back-pressure on the GPU by not acknowledging swap |
34 // calls until they appear on the screen. This can lead to hangs if the | 34 // calls until they appear on the screen. This can lead to hangs if the |
(...skipping 25 matching lines...) Expand all Loading... |
60 | 60 |
61 // Mark that the client is no longer valid and cannot be called back into. | 61 // Mark that the client is no longer valid and cannot be called back into. |
62 - (void)resetClient; | 62 - (void)resetClient; |
63 | 63 |
64 // Called when a new frame is received. | 64 // Called when a new frame is received. |
65 - (void)gotNewFrame; | 65 - (void)gotNewFrame; |
66 | 66 |
67 @end | 67 @end |
68 | 68 |
69 #endif // CONTENT_BROWSER_RENDERER_HOST_COMPOSITING_IOSURFACE_LAYER_MAC_H_ | 69 #endif // CONTENT_BROWSER_RENDERER_HOST_COMPOSITING_IOSURFACE_LAYER_MAC_H_ |
OLD | NEW |