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

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

Issue 8498036: Delay UpdateRect until the SwapBuffers callback when accelerated compositing is on. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 9 years, 1 month 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.cc
diff --git a/content/browser/renderer_host/render_widget_host.cc b/content/browser/renderer_host/render_widget_host.cc
index 404ff86093ef97319b1da921c70cda7dfbc631d1..461de1cc69230896df8ec57b9a03b5c8726be9cc 100644
--- a/content/browser/renderer_host/render_widget_host.cc
+++ b/content/browser/renderer_host/render_widget_host.cc
@@ -195,6 +195,7 @@ bool RenderWidgetHost::OnMessageReceived(const IPC::Message &msg) {
IPC_MESSAGE_HANDLER(ViewHostMsg_SetTooltipText, OnMsgSetTooltipText)
IPC_MESSAGE_HANDLER(ViewHostMsg_PaintAtSize_ACK, OnMsgPaintAtSizeAck)
IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateRect, OnMsgUpdateRect)
+ IPC_MESSAGE_HANDLER(ViewHostMsg_UpdateIsDelayed, OnMsgUpdateIsDelayed)
IPC_MESSAGE_HANDLER(ViewHostMsg_HandleInputEvent_ACK, OnMsgInputEventAck)
IPC_MESSAGE_HANDLER(ViewHostMsg_Focus, OnMsgFocus)
IPC_MESSAGE_HANDLER(ViewHostMsg_Blur, OnMsgBlur)
@@ -1036,17 +1037,23 @@ void RenderWidgetHost::OnMsgUpdateRect(
UMA_HISTOGRAM_TIMES("MPArch.RWH_OnMsgUpdateRect", delta);
}
+void RenderWidgetHost::OnMsgUpdateIsDelayed() {
+ // Nothing to do, this message was just to unblock the UI thread.
+}
+
void RenderWidgetHost::DidUpdateBackingStore(
const ViewHostMsg_UpdateRect_Params& params,
const TimeTicks& paint_start) {
TRACE_EVENT0("renderer_host", "RenderWidgetHost::DidUpdateBackingStore");
TimeTicks update_start = TimeTicks::Now();
- // ACK early so we can prefetch the next PaintRect if there is a next one.
- // This must be done AFTER we're done painting with the bitmap supplied by the
- // renderer. This ACK is a signal to the renderer that the backing store can
- // be re-used, so the bitmap may be invalid after this call.
- Send(new ViewMsg_UpdateRect_ACK(routing_id_));
+ if (ViewHostMsg_UpdateRect_Flags::needs_ack(params.flags)) {
+ // ACK early so we can prefetch the next PaintRect if there is a next one.
darin (slow to review) 2011/11/15 08:06:04 nit: indentation
piman 2011/11/16 01:00:55 Done.
+ // This must be done AFTER we're done painting with the bitmap supplied by
+ // the renderer. This ACK is a signal to the renderer that the backing
+ // store can be re-used, so the bitmap may be invalid after this call.
+ Send(new ViewMsg_UpdateRect_ACK(routing_id_));
+ }
// Move the plugins if the view hasn't already been destroyed. Plugin moves
// will not be re-issued, so must move them now, regardless of whether we

Powered by Google App Engine
This is Rietveld 408576698