OLD | NEW |
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 1046 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1057 // the work that we will need to do. | 1057 // the work that we will need to do. |
1058 invalidation_task_posted_ = true; | 1058 invalidation_task_posted_ = true; |
1059 MessageLoop::current()->PostTask( | 1059 MessageLoop::current()->PostTask( |
1060 FROM_HERE, base::Bind(&RenderWidget::InvalidationCallback, this)); | 1060 FROM_HERE, base::Bind(&RenderWidget::InvalidationCallback, this)); |
1061 } | 1061 } |
1062 | 1062 |
1063 void RenderWidget::didAutoResize(const WebSize& new_size) { | 1063 void RenderWidget::didAutoResize(const WebSize& new_size) { |
1064 size_ = new_size; | 1064 size_ = new_size; |
1065 } | 1065 } |
1066 | 1066 |
1067 void RenderWidget::didActivateCompositor(int compositor_identifier) { | 1067 void RenderWidget::didActivateCompositor(int input_handler_identifier) { |
1068 TRACE_EVENT0("gpu", "RenderWidget::didActivateCompositor"); | 1068 TRACE_EVENT0("gpu", "RenderWidget::didActivateCompositor"); |
1069 | 1069 |
1070 CompositorThread* compositor_thread = | 1070 CompositorThread* compositor_thread = |
1071 RenderThreadImpl::current()->compositor_thread(); | 1071 RenderThreadImpl::current()->compositor_thread(); |
1072 if (compositor_thread) | 1072 if (compositor_thread) |
1073 compositor_thread->AddCompositor(routing_id_, compositor_identifier); | 1073 compositor_thread->AddInputHandler(routing_id_, input_handler_identifier); |
1074 | 1074 |
1075 if (!is_accelerated_compositing_active_) { | 1075 if (!is_accelerated_compositing_active_) { |
1076 // When not in accelerated compositing mode, in certain cases (e.g. waiting | 1076 // When not in accelerated compositing mode, in certain cases (e.g. waiting |
1077 // for a resize or if no backing store) the RenderWidgetHost is blocking the | 1077 // for a resize or if no backing store) the RenderWidgetHost is blocking the |
1078 // browser's UI thread for some time, waiting for an UpdateRect. If we are | 1078 // browser's UI thread for some time, waiting for an UpdateRect. If we are |
1079 // going to switch to accelerated compositing, the GPU process may need | 1079 // going to switch to accelerated compositing, the GPU process may need |
1080 // round-trips to the browser's UI thread before finishing the frame, | 1080 // round-trips to the browser's UI thread before finishing the frame, |
1081 // causing deadlocks if we delay the UpdateRect until we receive the | 1081 // causing deadlocks if we delay the UpdateRect until we receive the |
1082 // OnSwapBuffersComplete. So send a dummy message that will unblock the | 1082 // OnSwapBuffersComplete. So send a dummy message that will unblock the |
1083 // browser's UI thread. | 1083 // browser's UI thread. |
(...skipping 577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1661 } | 1661 } |
1662 } | 1662 } |
1663 | 1663 |
1664 bool RenderWidget::WillHandleMouseEvent(const WebKit::WebMouseEvent& event) { | 1664 bool RenderWidget::WillHandleMouseEvent(const WebKit::WebMouseEvent& event) { |
1665 return false; | 1665 return false; |
1666 } | 1666 } |
1667 | 1667 |
1668 bool RenderWidget::WebWidgetHandlesCompositorScheduling() const { | 1668 bool RenderWidget::WebWidgetHandlesCompositorScheduling() const { |
1669 return false; | 1669 return false; |
1670 } | 1670 } |
OLD | NEW |