summaryrefslogtreecommitdiff
path: root/content/common/gpu/image_transport_surface_iosurface_mac.cc
diff options
context:
space:
mode:
authorTorne (Richard Coles) <torne@google.com>2014-08-19 13:00:08 +0100
committerTorne (Richard Coles) <torne@google.com>2014-08-19 13:00:08 +0100
commit6e8cce623b6e4fe0c9e4af605d675dd9d0338c38 (patch)
tree8d824ad26fac42e008142b86aa9631b2be7e4705 /content/common/gpu/image_transport_surface_iosurface_mac.cc
parent4f7316adb45db5ec3c9c1181ba9510c004566df8 (diff)
downloadchromium_org-6e8cce623b6e4fe0c9e4af605d675dd9d0338c38.tar.gz
Merge from Chromium at DEPS revision 290040
This commit was generated by merge_to_master.py. Change-Id: I694ec52d1e0b553f163c2faf4373d63270ab1aac
Diffstat (limited to 'content/common/gpu/image_transport_surface_iosurface_mac.cc')
-rw-r--r--content/common/gpu/image_transport_surface_iosurface_mac.cc16
1 files changed, 15 insertions, 1 deletions
diff --git a/content/common/gpu/image_transport_surface_iosurface_mac.cc b/content/common/gpu/image_transport_surface_iosurface_mac.cc
index 49aa4cda74..cbae4a2612 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