OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/debug/trace_event.h" |
8 #include "base/logging.h" | 9 #include "base/logging.h" |
9 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
10 #include "base/message_loop.h" | 11 #include "base/message_loop.h" |
11 #include "base/metrics/histogram.h" | 12 #include "base/metrics/histogram.h" |
12 #include "build/build_config.h" | 13 #include "build/build_config.h" |
13 #include "content/common/content_switches.h" | 14 #include "content/common/content_switches.h" |
14 #include "content/common/view_messages.h" | 15 #include "content/common/view_messages.h" |
15 #include "content/renderer/render_process.h" | 16 #include "content/renderer/render_process.h" |
16 #include "content/renderer/render_thread.h" | 17 #include "content/renderer/render_thread.h" |
17 #include "content/renderer/renderer_webkitclient_impl.h" | 18 #include "content/renderer/renderer_webkitclient_impl.h" |
18 #include "gpu/common/gpu_trace_event.h" | |
19 #include "ipc/ipc_sync_message.h" | 19 #include "ipc/ipc_sync_message.h" |
20 #include "skia/ext/platform_canvas.h" | 20 #include "skia/ext/platform_canvas.h" |
21 #include "third_party/skia/include/core/SkShader.h" | 21 #include "third_party/skia/include/core/SkShader.h" |
22 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCursorInfo.h" | 22 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCursorInfo.h" |
23 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPopupMenu.h" | 23 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPopupMenu.h" |
24 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPopupMenuInfo.h" | 24 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPopupMenuInfo.h" |
25 #include "third_party/WebKit/Source/WebKit/chromium/public/WebRect.h" | 25 #include "third_party/WebKit/Source/WebKit/chromium/public/WebRect.h" |
26 #include "third_party/WebKit/Source/WebKit/chromium/public/WebScreenInfo.h" | 26 #include "third_party/WebKit/Source/WebKit/chromium/public/WebScreenInfo.h" |
27 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSize.h" | 27 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSize.h" |
28 #include "ui/gfx/point.h" | 28 #include "ui/gfx/point.h" |
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
296 scheduleComposite(); | 296 scheduleComposite(); |
297 } | 297 } |
298 } | 298 } |
299 | 299 |
300 void RenderWidget::OnRequestMoveAck() { | 300 void RenderWidget::OnRequestMoveAck() { |
301 DCHECK(pending_window_rect_count_); | 301 DCHECK(pending_window_rect_count_); |
302 pending_window_rect_count_--; | 302 pending_window_rect_count_--; |
303 } | 303 } |
304 | 304 |
305 void RenderWidget::OnUpdateRectAck() { | 305 void RenderWidget::OnUpdateRectAck() { |
306 GPU_TRACE_EVENT0("renderer", "RenderWidget::OnUpdateRectAck"); | 306 TRACE_EVENT0("renderer", "RenderWidget::OnUpdateRectAck"); |
307 DCHECK(update_reply_pending()); | 307 DCHECK(update_reply_pending()); |
308 update_reply_pending_ = false; | 308 update_reply_pending_ = false; |
309 | 309 |
310 // If we sent an UpdateRect message with a zero-sized bitmap, then we should | 310 // If we sent an UpdateRect message with a zero-sized bitmap, then we should |
311 // have no current paint buffer. | 311 // have no current paint buffer. |
312 if (current_paint_buf_) { | 312 if (current_paint_buf_) { |
313 RenderProcess::current()->ReleaseTransportDIB(current_paint_buf_); | 313 RenderProcess::current()->ReleaseTransportDIB(current_paint_buf_); |
314 current_paint_buf_ = NULL; | 314 current_paint_buf_ = NULL; |
315 } | 315 } |
316 | 316 |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
544 } | 544 } |
545 | 545 |
546 void RenderWidget::CallDoDeferredUpdate() { | 546 void RenderWidget::CallDoDeferredUpdate() { |
547 DoDeferredUpdate(); | 547 DoDeferredUpdate(); |
548 | 548 |
549 if (pending_input_event_ack_.get()) | 549 if (pending_input_event_ack_.get()) |
550 Send(pending_input_event_ack_.release()); | 550 Send(pending_input_event_ack_.release()); |
551 } | 551 } |
552 | 552 |
553 void RenderWidget::DoDeferredUpdate() { | 553 void RenderWidget::DoDeferredUpdate() { |
554 GPU_TRACE_EVENT0("renderer", "RenderWidget::DoDeferredUpdate"); | 554 TRACE_EVENT0("renderer", "RenderWidget::DoDeferredUpdate"); |
555 | 555 |
556 if (!webwidget_ || update_reply_pending()) | 556 if (!webwidget_ || update_reply_pending()) |
557 return; | 557 return; |
558 | 558 |
559 // Suppress updating when we are hidden. | 559 // Suppress updating when we are hidden. |
560 if (is_hidden_ || size_.IsEmpty()) { | 560 if (is_hidden_ || size_.IsEmpty()) { |
561 paint_aggregator_.ClearPendingUpdate(); | 561 paint_aggregator_.ClearPendingUpdate(); |
562 needs_repainting_on_restore_ = true; | 562 needs_repainting_on_restore_ = true; |
563 return; | 563 return; |
564 } | 564 } |
(...skipping 547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1112 | 1112 |
1113 void RenderWidget::CleanupWindowInPluginMoves(gfx::PluginWindowHandle window) { | 1113 void RenderWidget::CleanupWindowInPluginMoves(gfx::PluginWindowHandle window) { |
1114 for (WebPluginGeometryVector::iterator i = plugin_window_moves_.begin(); | 1114 for (WebPluginGeometryVector::iterator i = plugin_window_moves_.begin(); |
1115 i != plugin_window_moves_.end(); ++i) { | 1115 i != plugin_window_moves_.end(); ++i) { |
1116 if (i->window == window) { | 1116 if (i->window == window) { |
1117 plugin_window_moves_.erase(i); | 1117 plugin_window_moves_.erase(i); |
1118 break; | 1118 break; |
1119 } | 1119 } |
1120 } | 1120 } |
1121 } | 1121 } |
OLD | NEW |