Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(474)

Unified Diff: content/common/gpu/image_transport_surface_calayer_mac.h

Issue 636003002: Clean up GPU back-pressure with remote CALayers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: O(1) more compile issue Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);
};
« no previous file with comments | « content/common/gpu/image_transport_surface.cc ('k') | content/common/gpu/image_transport_surface_calayer_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698