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_COMPOSITOR_IO_SURFACE_LAYER_MAC_H_ | 5 #ifndef UI_COMPOSITOR_MAC_IO_SURFACE_LAYER_MAC_H_ |
6 #define CONTENT_BROWSER_COMPOSITOR_IO_SURFACE_LAYER_MAC_H_ | 6 #define UI_COMPOSITOR_MAC_IO_SURFACE_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 #include "ui/gfx/size.h" | 13 #include "ui/gfx/size.h" |
14 | 14 |
15 @class IOSurfaceLayer; | 15 @class IOSurfaceLayer; |
16 | 16 |
17 namespace content { | 17 namespace content { |
18 class IOSurfaceTexture; | 18 class IOSurfaceTexture; |
19 class IOSurfaceContext; | 19 class IOSurfaceContext; |
20 | 20 |
21 // The interface through which the IOSurfaceLayer calls back into | 21 // The interface through which the IOSurfaceLayer calls back into |
22 // the structrue that created it (RenderWidgetHostViewMac or | 22 // the structrue that created it (RenderWidgetHostViewMac or |
23 // BrowserCompositorViewMac). | 23 // BrowserCompositorViewMac). |
24 class IOSurfaceLayerClient { | 24 class IOSurfaceLayerClient { |
25 public: | 25 public: |
26 // Used to indicate that the layer should attempt to draw immediately and | 26 // Used to indicate that the layer should attempt to draw immediately and |
27 // should (even if the draw is elided by the system), ack the frame | 27 // should (even if the draw is elided by the system), ack the frame |
28 // immediately. | 28 // immediately. |
29 virtual bool IOSurfaceLayerShouldAckImmediately() const = 0; | 29 virtual bool IOSurfaceLayerShouldAckImmediately() const = 0; |
30 | 30 |
ccameron
2014/11/25 17:54:25
I was wondering if to make the glFinish workaround
tapted
2014/11/25 23:53:55
re: odd plumbing: Ash faces a similar problem (i.e
| |
31 // Whether the IOSurface should use the glFinish() workaround after | |
32 // compositing. | |
33 virtual bool IOSurfaceNeedsGLFinishWorkaround() const = 0; | |
34 | |
31 // Called when a frame is drawn or when, because the layer is not visible, it | 35 // Called when a frame is drawn or when, because the layer is not visible, it |
32 // is known that the frame will never drawn. | 36 // is known that the frame will never drawn. |
33 virtual void IOSurfaceLayerDidDrawFrame() = 0; | 37 virtual void IOSurfaceLayerDidDrawFrame() = 0; |
34 | 38 |
35 // Called when an error prevents the frame from being drawn. | 39 // Called when an error prevents the frame from being drawn. |
36 virtual void IOSurfaceLayerHitError() = 0; | 40 virtual void IOSurfaceLayerHitError() = 0; |
37 }; | 41 }; |
38 | 42 |
39 // IOSurfaceLayerHelper provides C++ functionality needed for the | 43 // IOSurfaceLayerHelper provides C++ functionality needed for the |
40 // IOSurfaceLayer class, and does most of the heavy lifting for the | 44 // IOSurfaceLayer class, and does most of the heavy lifting for the |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
151 | 155 |
152 // Force a draw immediately, but only if one was requested. | 156 // Force a draw immediately, but only if one was requested. |
153 - (void)displayIfNeededAndAck; | 157 - (void)displayIfNeededAndAck; |
154 | 158 |
155 // Mark a bracket in which new frames are being pumped in a restricted nested | 159 // Mark a bracket in which new frames are being pumped in a restricted nested |
156 // run loop. | 160 // run loop. |
157 - (void)beginPumpingFrames; | 161 - (void)beginPumpingFrames; |
158 - (void)endPumpingFrames; | 162 - (void)endPumpingFrames; |
159 @end | 163 @end |
160 | 164 |
161 #endif // CONTENT_BROWSER_COMPOSITOR_IO_SURFACE_LAYER_MAC_H_ | 165 #endif // UI_COMPOSITOR_MAC_IO_SURFACE_LAYER_MAC_H_ |
OLD | NEW |