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

Unified Diff: content/common/gpu/image_transport_surface_iosurface_mac.cc

Issue 454243002: Make GPU back-pressure work with remote CALayers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix flashes Created 6 years, 4 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_iosurface_mac.cc
diff --git a/content/common/gpu/image_transport_surface_iosurface_mac.cc b/content/common/gpu/image_transport_surface_iosurface_mac.cc
index 49aa4cda74dbc32fe7e271bb617d344723c7a43c..cbae4a2612535fddbfa8dfaef2f01a5a1254b5e1 100644
--- a/content/common/gpu/image_transport_surface_iosurface_mac.cc
+++ b/content/common/gpu/image_transport_surface_iosurface_mac.cc
@@ -40,7 +40,9 @@ void AddIntegerValue(CFMutableDictionaryRef dictionary,
} // namespace
-IOSurfaceStorageProvider::IOSurfaceStorageProvider() {}
+IOSurfaceStorageProvider::IOSurfaceStorageProvider(
+ ImageTransportSurfaceFBO* transport_surface)
+ : transport_surface_(transport_surface) {}
IOSurfaceStorageProvider::~IOSurfaceStorageProvider() {
DCHECK(!io_surface_);
@@ -108,6 +110,18 @@ uint64 IOSurfaceStorageProvider::GetSurfaceHandle() const {
}
void IOSurfaceStorageProvider::WillSwapBuffers() {
+ // The browser compositor will throttle itself, so we are free to unblock the
+ // context immediately. Make sure that the browser is doing its throttling
+ // appropriately by ensuring that the previous swap was acknowledged before
+ // we get another swap.
+ DCHECK(pending_swapped_surfaces_.empty());
+ pending_swapped_surfaces_.push_back(io_surface_);
+ transport_surface_->UnblockContextAfterPendingSwap();
+}
+
+void IOSurfaceStorageProvider::CanFreeSwappedBuffer() {
+ DCHECK(!pending_swapped_surfaces_.empty());
+ pending_swapped_surfaces_.pop_front();
}
} // namespace content
« no previous file with comments | « content/common/gpu/image_transport_surface_iosurface_mac.h ('k') | content/common/gpu/image_transport_surface_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698