Skip to content

Commit

Permalink
Removing base::Time from SetAnimationEvents and PostAnimationEventsTo…
Browse files Browse the repository at this point in the history
…MainThreadOnImplThread.

As of "Remove wall time from NotifyAnimationStarted and NotifyAnimationFinished"
(https://src.chromium.org/viewvc/chrome?view=rev&revision=255888) the wall time
is no longer used in either of these functions.

BUG=299945

Review URL: https://codereview.chromium.org/194543002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@256237 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
mithro@mithis.com committed Mar 11, 2014
1 parent ecd6b74 commit 85b5750
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 33 deletions.
3 changes: 1 addition & 2 deletions cc/test/fake_layer_tree_host_impl_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ class FakeLayerTreeHostImplClient : public LayerTreeHostImplClient {
virtual void SetNeedsCommitOnImplThread() OVERRIDE {}
virtual void SetNeedsManageTilesOnImplThread() OVERRIDE {}
virtual void PostAnimationEventsToMainThreadOnImplThread(
scoped_ptr<AnimationEventsVector> events,
base::Time wall_clock_time) OVERRIDE {}
scoped_ptr<AnimationEventsVector> events) OVERRIDE {}
virtual bool ReduceContentsTextureMemoryOnImplThread(
size_t limit_bytes,
int priority_cutoff) OVERRIDE;
Expand Down
4 changes: 2 additions & 2 deletions cc/trees/layer_tree_host.cc
Original file line number Diff line number Diff line change
Expand Up @@ -562,8 +562,8 @@ void LayerTreeHost::SetNextCommitForcesRedraw() {
next_commit_forces_redraw_ = true;
}

void LayerTreeHost::SetAnimationEvents(scoped_ptr<AnimationEventsVector> events,
base::Time wall_clock_time) {
void LayerTreeHost::SetAnimationEvents(
scoped_ptr<AnimationEventsVector> events) {
DCHECK(proxy_->IsMainThread());
for (size_t event_index = 0; event_index < events->size(); ++event_index) {
int event_layer_id = (*events)[event_index].layer_id;
Expand Down
3 changes: 1 addition & 2 deletions cc/trees/layer_tree_host.h
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,7 @@ class CC_EXPORT LayerTreeHost {

void SetNextCommitForcesRedraw();

void SetAnimationEvents(scoped_ptr<AnimationEventsVector> events,
base::Time wall_clock_time);
void SetAnimationEvents(scoped_ptr<AnimationEventsVector> events);

void SetRootLayer(scoped_refptr<Layer> root_layer);
Layer* root_layer() { return root_layer_.get(); }
Expand Down
4 changes: 1 addition & 3 deletions cc/trees/layer_tree_host_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2697,7 +2697,6 @@ void LayerTreeHostImpl::AnimateLayers(base::TimeTicks monotonic_time,

TRACE_EVENT0("cc", "LayerTreeHostImpl::AnimateLayers");

last_animation_time_ = wall_clock_time;
double monotonic_seconds = (monotonic_time - base::TimeTicks()).InSecondsF();

AnimationRegistrar::AnimationControllerMap copy =
Expand Down Expand Up @@ -2727,8 +2726,7 @@ void LayerTreeHostImpl::UpdateAnimationState(bool start_ready_animations) {
(*iter).second->UpdateState(start_ready_animations, events.get());

if (!events->empty()) {
client_->PostAnimationEventsToMainThreadOnImplThread(events.Pass(),
last_animation_time_);
client_->PostAnimationEventsToMainThreadOnImplThread(events.Pass());
}
}

Expand Down
7 changes: 1 addition & 6 deletions cc/trees/layer_tree_host_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,7 @@ class LayerTreeHostImplClient {
virtual void SetNeedsCommitOnImplThread() = 0;
virtual void SetNeedsManageTilesOnImplThread() = 0;
virtual void PostAnimationEventsToMainThreadOnImplThread(
scoped_ptr<AnimationEventsVector> events,
base::Time wall_clock_time) = 0;
scoped_ptr<AnimationEventsVector> events) = 0;
// Returns true if resources were deleted by this call.
virtual bool ReduceContentsTextureMemoryOnImplThread(
size_t limit_bytes,
Expand Down Expand Up @@ -582,10 +581,6 @@ class CC_EXPORT LayerTreeHostImpl
bool pinch_gesture_end_should_clear_scrolling_layer_;
gfx::Point previous_pinch_anchor_;

// This is set by AnimateLayers() and used by UpdateAnimationState()
// when sending animation events to the main thread.
base::Time last_animation_time_;

scoped_ptr<TopControlsManager> top_controls_manager_;

scoped_ptr<PageScaleAnimation> page_scale_animation_;
Expand Down
3 changes: 1 addition & 2 deletions cc/trees/layer_tree_host_impl_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,7 @@ class LayerTreeHostImplTest : public testing::Test,
did_request_commit_ = true;
}
virtual void PostAnimationEventsToMainThreadOnImplThread(
scoped_ptr<AnimationEventsVector> events,
base::Time wall_clock_time) OVERRIDE {}
scoped_ptr<AnimationEventsVector> events) OVERRIDE {}
virtual bool ReduceContentsTextureMemoryOnImplThread(
size_t limit_bytes, int priority_cutoff) OVERRIDE {
current_limit_bytes_ = limit_bytes;
Expand Down
5 changes: 2 additions & 3 deletions cc/trees/single_thread_proxy.cc
Original file line number Diff line number Diff line change
Expand Up @@ -323,13 +323,12 @@ void SingleThreadProxy::SetNeedsCommitOnImplThread() {
}

void SingleThreadProxy::PostAnimationEventsToMainThreadOnImplThread(
scoped_ptr<AnimationEventsVector> events,
base::Time wall_clock_time) {
scoped_ptr<AnimationEventsVector> events) {
TRACE_EVENT0(
"cc", "SingleThreadProxy::PostAnimationEventsToMainThreadOnImplThread");
DCHECK(Proxy::IsImplThread());
DebugScopedSetMainThread main(this);
layer_tree_host_->SetAnimationEvents(events.Pass(), wall_clock_time);
layer_tree_host_->SetAnimationEvents(events.Pass());
}

bool SingleThreadProxy::ReduceContentsTextureMemoryOnImplThread(
Expand Down
3 changes: 1 addition & 2 deletions cc/trees/single_thread_proxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,7 @@ class SingleThreadProxy : public Proxy, LayerTreeHostImplClient {
virtual void DidInitializeVisibleTileOnImplThread() OVERRIDE;
virtual void SetNeedsCommitOnImplThread() OVERRIDE;
virtual void PostAnimationEventsToMainThreadOnImplThread(
scoped_ptr<AnimationEventsVector> events,
base::Time wall_clock_time) OVERRIDE;
scoped_ptr<AnimationEventsVector> events) OVERRIDE;
virtual bool ReduceContentsTextureMemoryOnImplThread(
size_t limit_bytes,
int priority_cutoff) OVERRIDE;
Expand Down
11 changes: 4 additions & 7 deletions cc/trees/thread_proxy.cc
Original file line number Diff line number Diff line change
Expand Up @@ -481,17 +481,15 @@ void ThreadProxy::SetNeedsCommitOnImplThread() {
}

void ThreadProxy::PostAnimationEventsToMainThreadOnImplThread(
scoped_ptr<AnimationEventsVector> events,
base::Time wall_clock_time) {
scoped_ptr<AnimationEventsVector> events) {
TRACE_EVENT0("cc",
"ThreadProxy::PostAnimationEventsToMainThreadOnImplThread");
DCHECK(IsImplThread());
Proxy::MainThreadTaskRunner()->PostTask(
FROM_HERE,
base::Bind(&ThreadProxy::SetAnimationEvents,
main_thread_weak_ptr_,
base::Passed(&events),
wall_clock_time));
base::Passed(&events)));
}

bool ThreadProxy::ReduceContentsTextureMemoryOnImplThread(size_t limit_bytes,
Expand Down Expand Up @@ -1420,13 +1418,12 @@ void ThreadProxy::DidCompleteSwapBuffers() {
layer_tree_host()->DidCompleteSwapBuffers();
}

void ThreadProxy::SetAnimationEvents(scoped_ptr<AnimationEventsVector> events,
base::Time wall_clock_time) {
void ThreadProxy::SetAnimationEvents(scoped_ptr<AnimationEventsVector> events) {
TRACE_EVENT0("cc", "ThreadProxy::SetAnimationEvents");
DCHECK(IsMainThread());
if (!layer_tree_host())
return;
layer_tree_host()->SetAnimationEvents(events.Pass(), wall_clock_time);
layer_tree_host()->SetAnimationEvents(events.Pass());
}

void ThreadProxy::CreateAndInitializeOutputSurface() {
Expand Down
6 changes: 2 additions & 4 deletions cc/trees/thread_proxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,7 @@ class ThreadProxy : public Proxy,
virtual void DidInitializeVisibleTileOnImplThread() OVERRIDE;
virtual void SetNeedsCommitOnImplThread() OVERRIDE;
virtual void PostAnimationEventsToMainThreadOnImplThread(
scoped_ptr<AnimationEventsVector> queue,
base::Time wall_clock_time) OVERRIDE;
scoped_ptr<AnimationEventsVector> queue) OVERRIDE;
virtual bool ReduceContentsTextureMemoryOnImplThread(size_t limit_bytes,
int priority_cutoff)
OVERRIDE;
Expand Down Expand Up @@ -146,8 +145,7 @@ class ThreadProxy : public Proxy,
scoped_ptr<BeginMainFrameAndCommitState> begin_main_frame_state);
void DidCommitAndDrawFrame();
void DidCompleteSwapBuffers();
void SetAnimationEvents(scoped_ptr<AnimationEventsVector> queue,
base::Time wall_clock_time);
void SetAnimationEvents(scoped_ptr<AnimationEventsVector> queue);
void DoCreateAndInitializeOutputSurface();
// |capabilities| is set only when |success| is true.
void OnOutputSurfaceInitializeAttempted(
Expand Down

0 comments on commit 85b5750

Please sign in to comment.