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