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

Unified Diff: content/browser/renderer_host/render_widget_host_view_mac.h

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: Re-resolve 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_view_mac.h
diff --git a/content/browser/renderer_host/render_widget_host_view_mac.h b/content/browser/renderer_host/render_widget_host_view_mac.h
index e1416331a55436eebc65f44105720cda45ea4a4d..aeab6e221605583b0d02d219457c485f4b7221ab 100644
--- a/content/browser/renderer_host/render_widget_host_view_mac.h
+++ b/content/browser/renderer_host/render_widget_host_view_mac.h
@@ -398,8 +398,11 @@ class RenderWidgetHostViewMac : public RenderWidgetHostViewBase,
// someone (other than superview) has retained |cocoa_view_|.
RenderWidgetHostImpl* render_widget_host_;
- // This is true when we are currently painting and thus should handle extra
- // paint requests by expanding the invalid rect rather than actually painting.
+ // This is true when we are currently painting. In the legacy renderer, this
+ // means we should handle extra paint requests by expanding the invalid rect
+ // rather than actually painting. In hardware compositing it means that we
+ // are inside a draw callback and should not wait for frames to draw before
+ // acknowledging them.
bool about_to_validate_and_paint_;
// This is true when we have already scheduled a call to
@@ -483,10 +486,24 @@ class RenderWidgetHostViewMac : public RenderWidgetHostViewBase,
void SendPendingLatencyInfoToHost();
void TickPendingLatencyInfoDelay();
+ void SendPendingSwapAck();
+
private:
friend class RenderWidgetHostView;
friend class RenderWidgetHostViewMacTest;
+ struct PendingSwapAck {
+ PendingSwapAck(int32 route_id, int gpu_host_id, int32 renderer_id)
+ : route_id(route_id),
+ gpu_host_id(gpu_host_id),
+ renderer_id(renderer_id) {}
+ int32 route_id;
+ int gpu_host_id;
+ int32 renderer_id;
+ };
+ scoped_ptr<PendingSwapAck> pending_swap_ack_;
+ void AddPendingSwapAck(int32 route_id, int gpu_host_id, int32 renderer_id);
+
// The view will associate itself with the given widget. The native view must
// be hooked up immediately to the view hierarchy, or else when it is
// deleted it will delete this out from under the caller.

Powered by Google App Engine
This is Rietveld 408576698