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