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

Side by Side Diff: content/renderer/render_widget.cc

Issue 12804006: cc: Save correct frame begin time to FrameRateCounter (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 years, 9 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/render_widget.h" 5 #include "content/renderer/render_widget.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/debug/trace_event.h" 9 #include "base/debug/trace_event.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 1166 matching lines...) Expand 10 before | Expand all | Expand 10 after
1177 } else { // Accelerated compositing path 1177 } else { // Accelerated compositing path
1178 // Begin painting. 1178 // Begin painting.
1179 // If painting is done via the gpu process then we don't set any damage 1179 // If painting is done via the gpu process then we don't set any damage
1180 // rects to save the browser process from doing unecessary work. 1180 // rects to save the browser process from doing unecessary work.
1181 pending_update_params_->bitmap_rect = bounds; 1181 pending_update_params_->bitmap_rect = bounds;
1182 pending_update_params_->scroll_rect = gfx::Rect(); 1182 pending_update_params_->scroll_rect = gfx::Rect();
1183 // We don't need an ack, because we're not sharing a DIB with the browser. 1183 // We don't need an ack, because we're not sharing a DIB with the browser.
1184 // If it needs to (e.g. composited UI), the GPU process does its own ACK 1184 // If it needs to (e.g. composited UI), the GPU process does its own ACK
1185 // with the browser for the GPU surface. 1185 // with the browser for the GPU surface.
1186 pending_update_params_->needs_ack = false; 1186 pending_update_params_->needs_ack = false;
1187 Composite(); 1187 Composite(frame_begin_ticks);
1188 } 1188 }
1189 1189
1190 // If we're holding a pending input event ACK, send the ACK before sending the 1190 // If we're holding a pending input event ACK, send the ACK before sending the
1191 // UpdateReply message so we can receive another input event before the 1191 // UpdateReply message so we can receive another input event before the
1192 // UpdateRect_ACK on platforms where the UpdateRect_ACK is sent from within 1192 // UpdateRect_ACK on platforms where the UpdateRect_ACK is sent from within
1193 // the UpdateRect IPC message handler. 1193 // the UpdateRect IPC message handler.
1194 if (pending_input_event_ack_.get()) 1194 if (pending_input_event_ack_.get())
1195 Send(pending_input_event_ack_.release()); 1195 Send(pending_input_event_ack_.release());
1196 1196
1197 // If Composite() called SwapBuffers, pending_update_params_ will be reset (in 1197 // If Composite() called SwapBuffers, pending_update_params_ will be reset (in
1198 // OnSwapBuffersPosted), meaning a message has been added to the 1198 // OnSwapBuffersPosted), meaning a message has been added to the
1199 // updates_pending_swap_ queue, that will be sent later. Otherwise, we send 1199 // updates_pending_swap_ queue, that will be sent later. Otherwise, we send
1200 // the message now. 1200 // the message now.
1201 if (pending_update_params_.get()) { 1201 if (pending_update_params_.get()) {
1202 // sending an ack to browser process that the paint is complete... 1202 // sending an ack to browser process that the paint is complete...
1203 update_reply_pending_ = pending_update_params_->needs_ack; 1203 update_reply_pending_ = pending_update_params_->needs_ack;
1204 Send(new ViewHostMsg_UpdateRect(routing_id_, *pending_update_params_)); 1204 Send(new ViewHostMsg_UpdateRect(routing_id_, *pending_update_params_));
1205 pending_update_params_.reset(); 1205 pending_update_params_.reset();
1206 } 1206 }
1207 1207
1208 // If we're software rendering then we're done initiating the paint. 1208 // If we're software rendering then we're done initiating the paint.
1209 if (!is_accelerated_compositing_active_) 1209 if (!is_accelerated_compositing_active_)
1210 DidInitiatePaint(); 1210 DidInitiatePaint();
1211 } 1211 }
1212 1212
1213 void RenderWidget::Composite() { 1213 void RenderWidget::Composite(base::TimeTicks frame_begin_time) {
1214 DCHECK(is_accelerated_compositing_active_); 1214 DCHECK(is_accelerated_compositing_active_);
1215 if (compositor_) // TODO(jamesr): Figure out how this can be null. 1215 if (compositor_) // TODO(jamesr): Figure out how this can be null.
1216 compositor_->Composite(); 1216 compositor_->Composite(frame_begin_time);
1217 } 1217 }
1218 1218
1219 /////////////////////////////////////////////////////////////////////////////// 1219 ///////////////////////////////////////////////////////////////////////////////
1220 // WebWidgetClient 1220 // WebWidgetClient
1221 1221
1222 void RenderWidget::didInvalidateRect(const WebRect& rect) { 1222 void RenderWidget::didInvalidateRect(const WebRect& rect) {
1223 TRACE_EVENT2("renderer", "RenderWidget::didInvalidateRect", 1223 TRACE_EVENT2("renderer", "RenderWidget::didInvalidateRect",
1224 "width", rect.width, "height", rect.height); 1224 "width", rect.width, "height", rect.height);
1225 // The invalidated rect might be outside the bounds of the view. 1225 // The invalidated rect might be outside the bounds of the view.
1226 gfx::Rect view_rect(size_); 1226 gfx::Rect view_rect(size_);
(...skipping 966 matching lines...) Expand 10 before | Expand all | Expand 10 after
2193 bool RenderWidget::WillHandleGestureEvent( 2193 bool RenderWidget::WillHandleGestureEvent(
2194 const WebKit::WebGestureEvent& event) { 2194 const WebKit::WebGestureEvent& event) {
2195 return false; 2195 return false;
2196 } 2196 }
2197 2197
2198 bool RenderWidget::HasTouchEventHandlersAt(const gfx::Point& point) const { 2198 bool RenderWidget::HasTouchEventHandlersAt(const gfx::Point& point) const {
2199 return true; 2199 return true;
2200 } 2200 }
2201 2201
2202 } // namespace content 2202 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698