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 @class CompositingIOSurfaceLayer; | 14 @class CompositingIOSurfaceLayer; |
15 | 15 |
16 namespace content { | 16 namespace content { |
17 class CompositingIOSurfaceMac; | 17 class CompositingIOSurfaceMac; |
18 class CompositingIOSurfaceContext; | 18 class CompositingIOSurfaceContext; |
19 | 19 |
20 // The interface through which the CompositingIOSurfaceLayer calls back into | 20 // The interface through which the CompositingIOSurfaceLayer calls back into |
21 // the structrue that created it (RenderWidgetHostViewMac or | 21 // the structrue that created it (RenderWidgetHostViewMac or |
22 // BrowserCompositorViewMac). | 22 // BrowserCompositorViewMac). |
23 class CompositingIOSurfaceLayerClient { | 23 class CompositingIOSurfaceLayerClient { |
24 public: | 24 public: |
| 25 // Used to indicate that the layer should attempt to draw immediately and |
| 26 // should (even if the draw is elided by the system), ack the frame |
| 27 // immediately. |
25 virtual bool AcceleratedLayerShouldAckImmediately() const = 0; | 28 virtual bool AcceleratedLayerShouldAckImmediately() const = 0; |
26 virtual void AcceleratedLayerDidDrawFrame(bool succeeded) = 0; | 29 |
| 30 // Called when a frame is drawn or when, because the layer is not visible, it |
| 31 // is known that the frame will never drawn. |
| 32 virtual void AcceleratedLayerDidDrawFrame() = 0; |
| 33 |
| 34 // Called when an error prevents the frame from being drawn. |
| 35 virtual void AcceleratedLayerHitError() = 0; |
27 }; | 36 }; |
28 | 37 |
29 // CompositingIOSurfaceLayerHelper provides C++ functionality needed for the | 38 // CompositingIOSurfaceLayerHelper provides C++ functionality needed for the |
30 // CompositingIOSurfaceLayer class, and does most of the heavy lifting for the | 39 // CompositingIOSurfaceLayer class, and does most of the heavy lifting for the |
31 // class. | 40 // class. |
32 // TODO(ccameron): This class should own CompositingIOSurfaceLayer, rather than | 41 // TODO(ccameron): This class should own CompositingIOSurfaceLayer, rather than |
33 // vice versa. | 42 // vice versa. |
34 class CompositingIOSurfaceLayerHelper { | 43 class CompositingIOSurfaceLayerHelper { |
35 public: | 44 public: |
36 CompositingIOSurfaceLayerHelper(CompositingIOSurfaceLayerClient* client, | 45 CompositingIOSurfaceLayerHelper(CompositingIOSurfaceLayerClient* client, |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 // Force a draw immediately, but only if one was requested. | 143 // Force a draw immediately, but only if one was requested. |
135 - (void)displayIfNeededAndAck; | 144 - (void)displayIfNeededAndAck; |
136 | 145 |
137 // Mark a bracket in which new frames are being pumped in a restricted nested | 146 // Mark a bracket in which new frames are being pumped in a restricted nested |
138 // run loop. | 147 // run loop. |
139 - (void)beginPumpingFrames; | 148 - (void)beginPumpingFrames; |
140 - (void)endPumpingFrames; | 149 - (void)endPumpingFrames; |
141 @end | 150 @end |
142 | 151 |
143 #endif // CONTENT_BROWSER_RENDERER_HOST_COMPOSITING_IOSURFACE_LAYER_MAC_H_ | 152 #endif // CONTENT_BROWSER_RENDERER_HOST_COMPOSITING_IOSURFACE_LAYER_MAC_H_ |
OLD | NEW |