Chromium Code Reviews| 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/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 633 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 644 } | 644 } |
| 645 | 645 |
| 646 void RenderWidget::AnimateIfNeeded() { | 646 void RenderWidget::AnimateIfNeeded() { |
| 647 if (!animation_update_pending_) | 647 if (!animation_update_pending_) |
| 648 return; | 648 return; |
| 649 | 649 |
| 650 // Target 60FPS if vsync is on. Go as fast as we can if vsync is off. | 650 // Target 60FPS if vsync is on. Go as fast as we can if vsync is off. |
| 651 int animationInterval = IsRenderingVSynced() ? 16 : 0; | 651 int animationInterval = IsRenderingVSynced() ? 16 : 0; |
| 652 | 652 |
| 653 base::Time now = base::Time::Now(); | 653 base::Time now = base::Time::Now(); |
| 654 if (now >= animation_floor_time_) { | 654 if (now >= animation_floor_time_ || is_accelerated_compositing_active_) { |
|
jamesr
2011/12/09 20:38:14
shouldn't this be checking using_asynchronous_swap
| |
| 655 TRACE_EVENT0("renderer", "RenderWidget::AnimateIfNeeded") | 655 TRACE_EVENT0("renderer", "RenderWidget::AnimateIfNeeded") |
| 656 animation_floor_time_ = now + | 656 animation_floor_time_ = now + |
| 657 base::TimeDelta::FromMilliseconds(animationInterval); | 657 base::TimeDelta::FromMilliseconds(animationInterval); |
| 658 // Set a timer to call us back after animationInterval before | 658 // Set a timer to call us back after animationInterval before |
| 659 // running animation callbacks so that if a callback requests another | 659 // running animation callbacks so that if a callback requests another |
| 660 // we'll be sure to run it at the proper time. | 660 // we'll be sure to run it at the proper time. |
| 661 MessageLoop::current()->PostDelayedTask( | 661 MessageLoop::current()->PostDelayedTask( |
| 662 FROM_HERE, base::Bind(&RenderWidget::AnimationCallback, this), | 662 FROM_HERE, base::Bind(&RenderWidget::AnimationCallback, this), |
| 663 animationInterval); | 663 animationInterval); |
| 664 animation_task_posted_ = true; | 664 animation_task_posted_ = true; |
| (...skipping 838 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1503 } | 1503 } |
| 1504 } | 1504 } |
| 1505 | 1505 |
| 1506 bool RenderWidget::WillHandleMouseEvent(const WebKit::WebMouseEvent& event) { | 1506 bool RenderWidget::WillHandleMouseEvent(const WebKit::WebMouseEvent& event) { |
| 1507 return false; | 1507 return false; |
| 1508 } | 1508 } |
| 1509 | 1509 |
| 1510 bool RenderWidget::WebWidgetHandlesCompositorScheduling() const { | 1510 bool RenderWidget::WebWidgetHandlesCompositorScheduling() const { |
| 1511 return false; | 1511 return false; |
| 1512 } | 1512 } |
| OLD | NEW |