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

Unified Diff: content/browser/renderer_host/render_widget_host_impl.cc

Issue 165703002: Do not send a frame swap ack from the browser until the frame is drawn (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@dynamic_async
Patch Set: Created 6 years, 10 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/browser/renderer_host/render_widget_host_impl.cc
diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc
index df2e948b3b5f88f012eba529579ded3e71a8c202..17cc7263bcf6b121b7b624e05164af9dd23689b8 100644
--- a/content/browser/renderer_host/render_widget_host_impl.cc
+++ b/content/browser/renderer_host/render_widget_host_impl.cc
@@ -787,6 +787,12 @@ void RenderWidgetHostImpl::PaintAtSize(TransportDIB::Handle dib_handle,
page_size, desired_size));
}
+void RenderWidgetHostImpl::SetAboutToWaitForBackingStoreCallback(
+ const base::Closure& about_to_wait_for_backing_store_callback) {
+ about_to_wait_for_backing_store_callback_ =
+ about_to_wait_for_backing_store_callback;
+}
+
bool RenderWidgetHostImpl::TryGetBackingStore(const gfx::Size& desired_size,
BackingStore** backing_store) {
// Check if the view has an accelerated surface of the desired size.
@@ -856,6 +862,11 @@ BackingStore* RenderWidgetHostImpl::GetBackingStore(bool force_create) {
do {
TRACE_EVENT0("renderer_host", "GetBackingStore::WaitForUpdate");
+ // Release any backpressure preventing the renderer from generating new
+ // frames.
+ if (!about_to_wait_for_backing_store_callback_.is_null())
+ about_to_wait_for_backing_store_callback_.Run();
ccameron 2014/02/14 02:19:06 The call that we need it before is this guy. It's
piman 2014/02/14 02:59:02 RWHVMac could send the ack right away when receivi
+
// When we have asked the RenderWidget to resize, and we are still waiting
// on a response, block for a little while to see if we can't get a response
// before returning the old (incorrectly sized) backing store.

Powered by Google App Engine
This is Rietveld 408576698