| 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 1381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1392 params.needs_ack = false; | 1392 params.needs_ack = false; |
| 1393 params.scale_factor = device_scale_factor_; | 1393 params.scale_factor = device_scale_factor_; |
| 1394 | 1394 |
| 1395 Send(new ViewHostMsg_UpdateRect(routing_id_, params)); | 1395 Send(new ViewHostMsg_UpdateRect(routing_id_, params)); |
| 1396 next_paint_flags_ = 0; | 1396 next_paint_flags_ = 0; |
| 1397 need_update_rect_for_auto_resize_ = false; | 1397 need_update_rect_for_auto_resize_ = false; |
| 1398 } | 1398 } |
| 1399 | 1399 |
| 1400 void RenderWidget::scheduleComposite() { | 1400 void RenderWidget::scheduleComposite() { |
| 1401 TRACE_EVENT0("gpu", "RenderWidget::scheduleComposite"); | 1401 TRACE_EVENT0("gpu", "RenderWidget::scheduleComposite"); |
| 1402 if (RenderThreadImpl::current()->compositor_thread() && | 1402 if (WebWidgetHandlesCompositorScheduling()) { |
| 1403 web_layer_tree_view_) { | 1403 webwidget_->composite(false); |
| 1404 web_layer_tree_view_->setNeedsRedraw(); | |
| 1405 } else { | 1404 } else { |
| 1406 // TODO(nduca): replace with something a little less hacky. The reason this | 1405 // TODO(nduca): replace with something a little less hacky. The reason this |
| 1407 // hack is still used is because the Invalidate-DoDeferredUpdate loop | 1406 // hack is still used is because the Invalidate-DoDeferredUpdate loop |
| 1408 // contains a lot of host-renderer synchronization logic that is still | 1407 // contains a lot of host-renderer synchronization logic that is still |
| 1409 // important for the accelerated compositing case. The option of simply | 1408 // important for the accelerated compositing case. The option of simply |
| 1410 // duplicating all that code is less desirable than "faking out" the | 1409 // duplicating all that code is less desirable than "faking out" the |
| 1411 // invalidation path using a magical damage rect. | 1410 // invalidation path using a magical damage rect. |
| 1412 didInvalidateRect(WebRect(0, 0, 1, 1)); | 1411 didInvalidateRect(WebRect(0, 0, 1, 1)); |
| 1413 } | 1412 } |
| 1414 } | 1413 } |
| (...skipping 687 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2102 | 2101 |
| 2103 bool RenderWidget::WillHandleMouseEvent(const WebKit::WebMouseEvent& event) { | 2102 bool RenderWidget::WillHandleMouseEvent(const WebKit::WebMouseEvent& event) { |
| 2104 return false; | 2103 return false; |
| 2105 } | 2104 } |
| 2106 | 2105 |
| 2107 bool RenderWidget::WillHandleGestureEvent( | 2106 bool RenderWidget::WillHandleGestureEvent( |
| 2108 const WebKit::WebGestureEvent& event) { | 2107 const WebKit::WebGestureEvent& event) { |
| 2109 return false; | 2108 return false; |
| 2110 } | 2109 } |
| 2111 | 2110 |
| 2111 bool RenderWidget::WebWidgetHandlesCompositorScheduling() const { |
| 2112 return false; |
| 2113 } |
| 2114 |
| 2112 bool RenderWidget::HasTouchEventHandlersAt(const gfx::Point& point) const { | 2115 bool RenderWidget::HasTouchEventHandlersAt(const gfx::Point& point) const { |
| 2113 return true; | 2116 return true; |
| 2114 } | 2117 } |
| 2115 | 2118 |
| 2116 } // namespace content | 2119 } // namespace content |
| OLD | NEW |