| 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 "chrome/common/chrome_switches.h" | 14 #include "chrome/common/chrome_switches.h" |
| 14 #include "chrome/common/render_messages.h" | 15 #include "chrome/common/render_messages.h" |
| 15 #include "chrome/renderer/render_process.h" | 16 #include "chrome/renderer/render_process.h" |
| 16 #include "content/common/view_messages.h" | 17 #include "content/common/view_messages.h" |
| 17 #include "content/renderer/render_thread.h" | 18 #include "content/renderer/render_thread.h" |
| 18 #include "content/renderer/renderer_webkitclient_impl.h" | 19 #include "content/renderer/renderer_webkitclient_impl.h" |
| 19 #include "gpu/common/gpu_trace_event.h" | |
| 20 #include "ipc/ipc_sync_message.h" | 20 #include "ipc/ipc_sync_message.h" |
| 21 #include "skia/ext/platform_canvas.h" | 21 #include "skia/ext/platform_canvas.h" |
| 22 #include "third_party/skia/include/core/SkShader.h" | 22 #include "third_party/skia/include/core/SkShader.h" |
| 23 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCursorInfo.h" | 23 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCursorInfo.h" |
| 24 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPopupMenu.h" | 24 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPopupMenu.h" |
| 25 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPopupMenuInfo.h" | 25 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPopupMenuInfo.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" |
| 29 #include "ui/gfx/point.h" | 29 #include "ui/gfx/point.h" |
| (...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 scheduleComposite(); | 293 scheduleComposite(); |
| 294 } | 294 } |
| 295 } | 295 } |
| 296 | 296 |
| 297 void RenderWidget::OnRequestMoveAck() { | 297 void RenderWidget::OnRequestMoveAck() { |
| 298 DCHECK(pending_window_rect_count_); | 298 DCHECK(pending_window_rect_count_); |
| 299 pending_window_rect_count_--; | 299 pending_window_rect_count_--; |
| 300 } | 300 } |
| 301 | 301 |
| 302 void RenderWidget::OnUpdateRectAck() { | 302 void RenderWidget::OnUpdateRectAck() { |
| 303 GPU_TRACE_EVENT0("renderer", "RenderWidget::OnUpdateRectAck"); | 303 TRACE_EVENT0("renderer", "RenderWidget::OnUpdateRectAck"); |
| 304 DCHECK(update_reply_pending()); | 304 DCHECK(update_reply_pending()); |
| 305 update_reply_pending_ = false; | 305 update_reply_pending_ = false; |
| 306 | 306 |
| 307 // If we sent an UpdateRect message with a zero-sized bitmap, then we should | 307 // If we sent an UpdateRect message with a zero-sized bitmap, then we should |
| 308 // have no current paint buffer. | 308 // have no current paint buffer. |
| 309 if (current_paint_buf_) { | 309 if (current_paint_buf_) { |
| 310 RenderProcess::current()->ReleaseTransportDIB(current_paint_buf_); | 310 RenderProcess::current()->ReleaseTransportDIB(current_paint_buf_); |
| 311 current_paint_buf_ = NULL; | 311 current_paint_buf_ = NULL; |
| 312 } | 312 } |
| 313 | 313 |
| (...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 541 } | 541 } |
| 542 | 542 |
| 543 void RenderWidget::CallDoDeferredUpdate() { | 543 void RenderWidget::CallDoDeferredUpdate() { |
| 544 DoDeferredUpdate(); | 544 DoDeferredUpdate(); |
| 545 | 545 |
| 546 if (pending_input_event_ack_.get()) | 546 if (pending_input_event_ack_.get()) |
| 547 Send(pending_input_event_ack_.release()); | 547 Send(pending_input_event_ack_.release()); |
| 548 } | 548 } |
| 549 | 549 |
| 550 void RenderWidget::DoDeferredUpdate() { | 550 void RenderWidget::DoDeferredUpdate() { |
| 551 GPU_TRACE_EVENT0("renderer", "RenderWidget::DoDeferredUpdate"); | 551 TRACE_EVENT0("renderer", "RenderWidget::DoDeferredUpdate"); |
| 552 | 552 |
| 553 if (!webwidget_ || update_reply_pending()) | 553 if (!webwidget_ || update_reply_pending()) |
| 554 return; | 554 return; |
| 555 | 555 |
| 556 // Suppress updating when we are hidden. | 556 // Suppress updating when we are hidden. |
| 557 if (is_hidden_ || size_.IsEmpty()) { | 557 if (is_hidden_ || size_.IsEmpty()) { |
| 558 paint_aggregator_.ClearPendingUpdate(); | 558 paint_aggregator_.ClearPendingUpdate(); |
| 559 needs_repainting_on_restore_ = true; | 559 needs_repainting_on_restore_ = true; |
| 560 return; | 560 return; |
| 561 } | 561 } |
| (...skipping 547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1109 | 1109 |
| 1110 void RenderWidget::CleanupWindowInPluginMoves(gfx::PluginWindowHandle window) { | 1110 void RenderWidget::CleanupWindowInPluginMoves(gfx::PluginWindowHandle window) { |
| 1111 for (WebPluginGeometryVector::iterator i = plugin_window_moves_.begin(); | 1111 for (WebPluginGeometryVector::iterator i = plugin_window_moves_.begin(); |
| 1112 i != plugin_window_moves_.end(); ++i) { | 1112 i != plugin_window_moves_.end(); ++i) { |
| 1113 if (i->window == window) { | 1113 if (i->window == window) { |
| 1114 plugin_window_moves_.erase(i); | 1114 plugin_window_moves_.erase(i); |
| 1115 break; | 1115 break; |
| 1116 } | 1116 } |
| 1117 } | 1117 } |
| 1118 } | 1118 } |
| OLD | NEW |