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" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
44 void SetNeedsDisplay(); | 44 void SetNeedsDisplay(); |
45 | 45 |
46 // Called whenever -[CompositingIOSurfaceLayer canDrawInCGLContext] is called, | 46 // Called whenever -[CompositingIOSurfaceLayer canDrawInCGLContext] is called, |
47 // to determine if a new frame should be drawn. | 47 // to determine if a new frame should be drawn. |
48 bool CanDraw(); | 48 bool CanDraw(); |
49 | 49 |
50 // Called whenever -[CompositingIOSurfaceLayer drawInCGLContext] draws a | 50 // Called whenever -[CompositingIOSurfaceLayer drawInCGLContext] draws a |
51 // frame. | 51 // frame. |
52 void DidDraw(bool success); | 52 void DidDraw(bool success); |
53 | 53 |
54 // Immediately re-draw the layer, even if the content has not changed, and | |
55 // ensure that the frame be acked. | |
ccameron
2014/07/22 06:40:42
I renamed these methods to be a bit more explicit.
| |
56 void SetNeedsDisplayAndDisplayAndAck(); | |
57 | |
58 // Immediately draw the layer, only if one is pending, and ensure that the | |
59 // frame be acked. | |
60 void DisplayIfNeededAndAck(); | |
54 private: | 61 private: |
55 // Immediately draw a frame (disregarding vsync) and ensure that the frame is | |
56 // acknowledged. | |
57 void ImmediatelyForceDisplayAndAck(); | |
58 | 62 |
59 // Called whenever the frame provided in GotNewFrame should be acknowledged | 63 // Called whenever the frame provided in GotNewFrame should be acknowledged |
60 // (this may be because it was drawn, or it may be to unblock the | 64 // (this may be because it was drawn, or it may be to unblock the |
61 // compositor). | 65 // compositor). |
62 void AckPendingFrame(bool success); | 66 void AckPendingFrame(bool success); |
63 | 67 |
64 void TimerFired(); | 68 void TimerFired(); |
65 | 69 |
66 // The client that the owning layer was created with. | 70 // The client that the owning layer was created with. |
67 content::CompositingIOSurfaceLayerClient* const client_; | 71 content::CompositingIOSurfaceLayerClient* const client_; |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
107 withScaleFactor:(float)scale_factor | 111 withScaleFactor:(float)scale_factor |
108 withClient:(content::CompositingIOSurfaceLayerClient*)client; | 112 withClient:(content::CompositingIOSurfaceLayerClient*)client; |
109 | 113 |
110 // Mark that the client is no longer valid and cannot be called back into. This | 114 // Mark that the client is no longer valid and cannot be called back into. This |
111 // must be called before the layer is destroyed. | 115 // must be called before the layer is destroyed. |
112 - (void)resetClient; | 116 - (void)resetClient; |
113 | 117 |
114 // Called when a new frame is received. | 118 // Called when a new frame is received. |
115 - (void)gotNewFrame; | 119 - (void)gotNewFrame; |
116 | 120 |
121 // Force a draw immediately (even if this means re-displaying a previously | |
122 // displayed frame). | |
123 - (void)setNeedsDisplayAndDisplayAndAck; | |
124 | |
125 // Force a draw immediately, but only if one was requested. | |
126 - (void)displayIfNeededAndAck; | |
127 | |
117 @end | 128 @end |
118 | 129 |
119 #endif // CONTENT_BROWSER_RENDERER_HOST_COMPOSITING_IOSURFACE_LAYER_MAC_H_ | 130 #endif // CONTENT_BROWSER_RENDERER_HOST_COMPOSITING_IOSURFACE_LAYER_MAC_H_ |
OLD | NEW |