Index: content/common/gpu/image_transport_surface_calayer_mac.h |
diff --git a/content/common/gpu/image_transport_surface_calayer_mac.h b/content/common/gpu/image_transport_surface_calayer_mac.h |
index 20ccce35cee59b5f0b79d692e0e115c32d49c1e1..59aaf6ffff62df4683dd879a150b45dc8862bd84 100644 |
--- a/content/common/gpu/image_transport_surface_calayer_mac.h |
+++ b/content/common/gpu/image_transport_surface_calayer_mac.h |
@@ -31,7 +31,7 @@ class CALayerStorageProvider |
virtual void SwapBuffers(const gfx::Size& size, float scale_factor) override; |
virtual void WillWriteToBackbuffer() override; |
virtual void DiscardBackbuffer() override; |
- virtual void SwapBuffersAckedByBrowser() override; |
+ virtual void SwapBuffersAckedByBrowser(bool disable_throttling) override; |
// Interface to ImageTransportLayer: |
CGLContextObj LayerShareGroupContext(); |
@@ -40,8 +40,11 @@ class CALayerStorageProvider |
void LayerResetStorageProvider(); |
private: |
- void DrawWithVsyncDisabled(); |
- void SendPendingSwapToBrowserAfterFrameDrawn(); |
+ void DrawImmediatelyAndUnblockBrowser(); |
+ |
+ // The browser will be blocked while there is a frame that was sent to it but |
+ // hasn't drawn yet. This call will un-block the browser. |
+ void UnblockBrowserIfNeeded(); |
ImageTransportSurfaceFBO* transport_surface_; |
@@ -49,6 +52,10 @@ class CALayerStorageProvider |
// animate. |
const bool gpu_vsync_disabled_; |
+ // Used also to determine if we should wait for CoreAnimation to call our |
+ // drawInCGLContext, or if we should force it with displayIfNeeded. |
+ bool throttling_disabled_; |
+ |
// Set when a new swap occurs, and un-set when |layer_| draws that frame. |
bool has_pending_draw_; |
@@ -68,7 +75,9 @@ class CALayerStorageProvider |
base::scoped_nsobject<CAContext> context_; |
base::scoped_nsobject<ImageTransportLayer> layer_; |
- base::WeakPtrFactory<CALayerStorageProvider> weak_factory_; |
+ // Weak factory against which a timeout task for forcing a draw is created. |
+ base::WeakPtrFactory<CALayerStorageProvider> pending_draw_weak_factory_; |
+ |
DISALLOW_COPY_AND_ASSIGN(CALayerStorageProvider); |
}; |