Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "cc/trees/layer_tree_host.h" | 5 #include "cc/trees/layer_tree_host.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <stack> | 8 #include <stack> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 32 #include "cc/resources/prioritized_resource_manager.h" | 32 #include "cc/resources/prioritized_resource_manager.h" |
| 33 #include "cc/resources/ui_resource_request.h" | 33 #include "cc/resources/ui_resource_request.h" |
| 34 #include "cc/trees/layer_tree_host_client.h" | 34 #include "cc/trees/layer_tree_host_client.h" |
| 35 #include "cc/trees/layer_tree_host_common.h" | 35 #include "cc/trees/layer_tree_host_common.h" |
| 36 #include "cc/trees/layer_tree_host_impl.h" | 36 #include "cc/trees/layer_tree_host_impl.h" |
| 37 #include "cc/trees/layer_tree_impl.h" | 37 #include "cc/trees/layer_tree_impl.h" |
| 38 #include "cc/trees/occlusion_tracker.h" | 38 #include "cc/trees/occlusion_tracker.h" |
| 39 #include "cc/trees/single_thread_proxy.h" | 39 #include "cc/trees/single_thread_proxy.h" |
| 40 #include "cc/trees/thread_proxy.h" | 40 #include "cc/trees/thread_proxy.h" |
| 41 #include "cc/trees/tree_synchronizer.h" | 41 #include "cc/trees/tree_synchronizer.h" |
| 42 #include "ui/gfx/frame_time.h" | |
| 42 #include "ui/gfx/size_conversions.h" | 43 #include "ui/gfx/size_conversions.h" |
| 43 | 44 |
| 44 namespace { | 45 namespace { |
| 45 static base::StaticAtomicSequenceNumber s_layer_tree_host_sequence_number; | 46 static base::StaticAtomicSequenceNumber s_layer_tree_host_sequence_number; |
| 46 } | 47 } |
| 47 | 48 |
| 48 namespace cc { | 49 namespace cc { |
| 49 | 50 |
| 50 RendererCapabilities::RendererCapabilities(ResourceFormat best_texture_format, | 51 RendererCapabilities::RendererCapabilities(ResourceFormat best_texture_format, |
| 51 bool allow_partial_texture_updates, | 52 bool allow_partial_texture_updates, |
| (...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 556 | 557 |
| 557 void LayerTreeHost::SetNextCommitWaitsForActivation() { | 558 void LayerTreeHost::SetNextCommitWaitsForActivation() { |
| 558 proxy_->SetNextCommitWaitsForActivation(); | 559 proxy_->SetNextCommitWaitsForActivation(); |
| 559 } | 560 } |
| 560 | 561 |
| 561 void LayerTreeHost::SetNextCommitForcesRedraw() { | 562 void LayerTreeHost::SetNextCommitForcesRedraw() { |
| 562 next_commit_forces_redraw_ = true; | 563 next_commit_forces_redraw_ = true; |
| 563 } | 564 } |
| 564 | 565 |
| 565 void LayerTreeHost::SetAnimationEvents(scoped_ptr<AnimationEventsVector> events, | 566 void LayerTreeHost::SetAnimationEvents(scoped_ptr<AnimationEventsVector> events, |
| 566 base::Time wall_clock_time) { | 567 base::TimeTicks clock_time) { |
| 567 DCHECK(proxy_->IsMainThread()); | 568 DCHECK(proxy_->IsMainThread()); |
| 568 for (size_t event_index = 0; event_index < events->size(); ++event_index) { | 569 for (size_t event_index = 0; event_index < events->size(); ++event_index) { |
| 569 int event_layer_id = (*events)[event_index].layer_id; | 570 int event_layer_id = (*events)[event_index].layer_id; |
| 570 | 571 |
| 571 // Use the map of all controllers, not just active ones, since non-active | 572 // Use the map of all controllers, not just active ones, since non-active |
| 572 // controllers may still receive events for impl-only animations. | 573 // controllers may still receive events for impl-only animations. |
| 573 const AnimationRegistrar::AnimationControllerMap& animation_controllers = | 574 const AnimationRegistrar::AnimationControllerMap& animation_controllers = |
| 574 animation_registrar_->all_animation_controllers(); | 575 animation_registrar_->all_animation_controllers(); |
| 575 AnimationRegistrar::AnimationControllerMap::const_iterator iter = | 576 AnimationRegistrar::AnimationControllerMap::const_iterator iter = |
| 576 animation_controllers.find(event_layer_id); | 577 animation_controllers.find(event_layer_id); |
| 577 if (iter != animation_controllers.end()) { | 578 if (iter != animation_controllers.end()) { |
| 578 switch ((*events)[event_index].type) { | 579 switch ((*events)[event_index].type) { |
| 579 case AnimationEvent::Started: | 580 case AnimationEvent::Started: |
| 580 (*iter).second->NotifyAnimationStarted((*events)[event_index], | 581 (*iter).second->NotifyAnimationStarted((*events)[event_index], |
| 581 wall_clock_time.ToDoubleT()); | 582 clock_time.ToWebKit()); |
|
ajuma
2014/02/28 02:32:03
This seems incorrect, since the callee is expectin
| |
| 582 break; | 583 break; |
| 583 | 584 |
| 584 case AnimationEvent::Finished: | 585 case AnimationEvent::Finished: |
| 585 (*iter).second->NotifyAnimationFinished((*events)[event_index], | 586 (*iter).second->NotifyAnimationFinished((*events)[event_index], |
| 586 wall_clock_time.ToDoubleT()); | 587 clock_time.ToWebKit()); |
| 587 break; | 588 break; |
| 588 | 589 |
| 589 case AnimationEvent::Aborted: | 590 case AnimationEvent::Aborted: |
| 590 (*iter).second->NotifyAnimationAborted((*events)[event_index]); | 591 (*iter).second->NotifyAnimationAborted((*events)[event_index]); |
| 591 break; | 592 break; |
| 592 | 593 |
| 593 case AnimationEvent::PropertyUpdate: | 594 case AnimationEvent::PropertyUpdate: |
| 594 (*iter).second->NotifyAnimationPropertyUpdate((*events)[event_index]); | 595 (*iter).second->NotifyAnimationPropertyUpdate((*events)[event_index]); |
| 595 break; | 596 break; |
| 596 } | 597 } |
| (...skipping 715 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1312 swap_promise_list_.push_back(swap_promise.Pass()); | 1313 swap_promise_list_.push_back(swap_promise.Pass()); |
| 1313 } | 1314 } |
| 1314 | 1315 |
| 1315 void LayerTreeHost::BreakSwapPromises(SwapPromise::DidNotSwapReason reason) { | 1316 void LayerTreeHost::BreakSwapPromises(SwapPromise::DidNotSwapReason reason) { |
| 1316 for (size_t i = 0; i < swap_promise_list_.size(); i++) | 1317 for (size_t i = 0; i < swap_promise_list_.size(); i++) |
| 1317 swap_promise_list_[i]->DidNotSwap(reason); | 1318 swap_promise_list_[i]->DidNotSwap(reason); |
| 1318 swap_promise_list_.clear(); | 1319 swap_promise_list_.clear(); |
| 1319 } | 1320 } |
| 1320 | 1321 |
| 1321 } // namespace cc | 1322 } // namespace cc |
| OLD | NEW |