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/WebRange.h" | 25 #include "third_party/WebKit/Source/WebKit/chromium/public/WebRange.h" |
26 #include "third_party/WebKit/Source/WebKit/chromium/public/WebRect.h" | 26 #include "third_party/WebKit/Source/WebKit/chromium/public/WebRect.h" |
27 #include "third_party/WebKit/Source/WebKit/chromium/public/WebScreenInfo.h" | 27 #include "third_party/WebKit/Source/WebKit/chromium/public/WebScreenInfo.h" |
28 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSize.h" | 28 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSize.h" |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
298 scheduleComposite(); | 298 scheduleComposite(); |
299 } | 299 } |
300 } | 300 } |
301 | 301 |
302 void RenderWidget::OnRequestMoveAck() { | 302 void RenderWidget::OnRequestMoveAck() { |
303 DCHECK(pending_window_rect_count_); | 303 DCHECK(pending_window_rect_count_); |
304 pending_window_rect_count_--; | 304 pending_window_rect_count_--; |
305 } | 305 } |
306 | 306 |
307 void RenderWidget::OnUpdateRectAck() { | 307 void RenderWidget::OnUpdateRectAck() { |
308 GPU_TRACE_EVENT0("renderer", "RenderWidget::OnUpdateRectAck"); | 308 TRACE_EVENT0("renderer", "RenderWidget::OnUpdateRectAck"); |
309 DCHECK(update_reply_pending()); | 309 DCHECK(update_reply_pending()); |
310 update_reply_pending_ = false; | 310 update_reply_pending_ = false; |
311 | 311 |
312 // If we sent an UpdateRect message with a zero-sized bitmap, then we should | 312 // If we sent an UpdateRect message with a zero-sized bitmap, then we should |
313 // have no current paint buffer. | 313 // have no current paint buffer. |
314 if (current_paint_buf_) { | 314 if (current_paint_buf_) { |
315 RenderProcess::current()->ReleaseTransportDIB(current_paint_buf_); | 315 RenderProcess::current()->ReleaseTransportDIB(current_paint_buf_); |
316 current_paint_buf_ = NULL; | 316 current_paint_buf_ = NULL; |
317 } | 317 } |
318 | 318 |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
546 } | 546 } |
547 | 547 |
548 void RenderWidget::CallDoDeferredUpdate() { | 548 void RenderWidget::CallDoDeferredUpdate() { |
549 DoDeferredUpdate(); | 549 DoDeferredUpdate(); |
550 | 550 |
551 if (pending_input_event_ack_.get()) | 551 if (pending_input_event_ack_.get()) |
552 Send(pending_input_event_ack_.release()); | 552 Send(pending_input_event_ack_.release()); |
553 } | 553 } |
554 | 554 |
555 void RenderWidget::DoDeferredUpdate() { | 555 void RenderWidget::DoDeferredUpdate() { |
556 GPU_TRACE_EVENT0("renderer", "RenderWidget::DoDeferredUpdate"); | 556 TRACE_EVENT0("renderer", "RenderWidget::DoDeferredUpdate"); |
557 | 557 |
558 if (!webwidget_ || update_reply_pending()) | 558 if (!webwidget_ || update_reply_pending()) |
559 return; | 559 return; |
560 | 560 |
561 // Suppress updating when we are hidden. | 561 // Suppress updating when we are hidden. |
562 if (is_hidden_ || size_.IsEmpty()) { | 562 if (is_hidden_ || size_.IsEmpty()) { |
563 paint_aggregator_.ClearPendingUpdate(); | 563 paint_aggregator_.ClearPendingUpdate(); |
564 needs_repainting_on_restore_ = true; | 564 needs_repainting_on_restore_ = true; |
565 return; | 565 return; |
566 } | 566 } |
(...skipping 588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1155 | 1155 |
1156 void RenderWidget::CleanupWindowInPluginMoves(gfx::PluginWindowHandle window) { | 1156 void RenderWidget::CleanupWindowInPluginMoves(gfx::PluginWindowHandle window) { |
1157 for (WebPluginGeometryVector::iterator i = plugin_window_moves_.begin(); | 1157 for (WebPluginGeometryVector::iterator i = plugin_window_moves_.begin(); |
1158 i != plugin_window_moves_.end(); ++i) { | 1158 i != plugin_window_moves_.end(); ++i) { |
1159 if (i->window == window) { | 1159 if (i->window == window) { |
1160 plugin_window_moves_.erase(i); | 1160 plugin_window_moves_.erase(i); |
1161 break; | 1161 break; |
1162 } | 1162 } |
1163 } | 1163 } |
1164 } | 1164 } |
OLD | NEW |