Skip to content

Commit

Permalink
Rename variables that were missed from the previous renaming patch
Browse files Browse the repository at this point in the history
In patch https://chromium-review.googlesource.com/906830 we renamed cc
side animation related classes but there are some variables missing,
e.g. animation_id instead of keyframe_model_id. This should be fixed
before next patch which will rename AnimationPlayer to Animation so that
it won't conflict with the new "animation_id".

Bug: 807667
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_vr;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel
Change-Id: Id5a8d07a7e551fff78b746728fce3dd139bb5b21
Reviewed-on: https://chromium-review.googlesource.com/922342
Reviewed-by: Ian Vollick <vollick@chromium.org>
Commit-Queue: Yi Gu <yigu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#537199}
  • Loading branch information
yi-gu authored and Commit Bot committed Feb 16, 2018
1 parent 330186a commit f1fe859
Show file tree
Hide file tree
Showing 9 changed files with 198 additions and 178 deletions.
4 changes: 2 additions & 2 deletions cc/animation/animation_player.cc
Original file line number Diff line number Diff line change
Expand Up @@ -200,11 +200,11 @@ void AnimationPlayer::PushPropertiesToImplThread(AnimationPlayer* player_impl) {
}

void AnimationPlayer::AddKeyframeModelForKeyframeEffect(
std::unique_ptr<KeyframeModel> animation,
std::unique_ptr<KeyframeModel> keyframe_model,
KeyframeEffectId keyframe_effect_id) {
DCHECK(GetKeyframeEffectById(keyframe_effect_id));
GetKeyframeEffectById(keyframe_effect_id)
->AddKeyframeModel(std::move(animation));
->AddKeyframeModel(std::move(keyframe_model));
}

void AnimationPlayer::PauseKeyframeModelForKeyframeEffect(
Expand Down
8 changes: 4 additions & 4 deletions cc/animation/animation_player.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,15 @@ class CC_ANIMATION_EXPORT AnimationPlayer
virtual void DetachElement();

void AddKeyframeModelForKeyframeEffect(
std::unique_ptr<KeyframeModel> animation,
std::unique_ptr<KeyframeModel> keyframe_model,
KeyframeEffectId keyframe_effect_id);
void PauseKeyframeModelForKeyframeEffect(int animation_id,
void PauseKeyframeModelForKeyframeEffect(int keyframe_model_id,
double time_offset,
KeyframeEffectId keyframe_effect_id);
void RemoveKeyframeModelForKeyframeEffect(
int animation_id,
int keyframe_model_id,
KeyframeEffectId keyframe_effect_id);
void AbortKeyframeModelForKeyframeEffect(int animation_id,
void AbortKeyframeModelForKeyframeEffect(int keyframe_model_id,
KeyframeEffectId keyframe_effect_id);
void AbortKeyframeModels(TargetProperty::Type target_property,
bool needs_completion);
Expand Down
321 changes: 170 additions & 151 deletions cc/animation/element_animations_unittest.cc

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions cc/animation/keyframe_effect.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CC_ANIMATION_KEYFRAME_EFFECT_H
#define CC_ANIMATION_KEYFRAME_EFFECT_H
#ifndef CC_ANIMATION_KEYFRAME_EFFECT_H_
#define CC_ANIMATION_KEYFRAME_EFFECT_H_

#include "base/macros.h"
#include "base/memory/ref_counted.h"
Expand Down Expand Up @@ -90,15 +90,15 @@ class CC_ANIMATION_EXPORT KeyframeEffect {
void Tick(base::TimeTicks monotonic_time,
const AnimationTimeProvider* tick_provider);
static void TickKeyframeModel(base::TimeTicks monotonic_time,
KeyframeModel* animation,
KeyframeModel* keyframe_model,
AnimationTarget* target);
void RemoveFromTicking();
bool is_ticking() const { return is_ticking_; }

void UpdateState(bool start_ready_keyframe_models, AnimationEvents* events);
void UpdateTickingState(UpdateTickingType type);

void AddKeyframeModel(std::unique_ptr<KeyframeModel> animation);
void AddKeyframeModel(std::unique_ptr<KeyframeModel> keyframe_model);
void PauseKeyframeModel(int keyframe_model_id, double time_offset);
void RemoveKeyframeModel(int keyframe_model_id);
void AbortKeyframeModel(int keyframe_model_id);
Expand Down
4 changes: 2 additions & 2 deletions cc/animation/single_keyframe_effect_animation_player.cc
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ KeyframeEffect* SingleKeyframeEffectAnimationPlayer::keyframe_effect() const {
}

void SingleKeyframeEffectAnimationPlayer::AddKeyframeModel(
std::unique_ptr<KeyframeModel> animation) {
AddKeyframeModelForKeyframeEffect(std::move(animation),
std::unique_ptr<KeyframeModel> keyframe_model) {
AddKeyframeModelForKeyframeEffect(std::move(keyframe_model),
GetKeyframeEffect()->id());
}

Expand Down
15 changes: 8 additions & 7 deletions chrome/browser/vr/elements/ui_element.cc
Original file line number Diff line number Diff line change
Expand Up @@ -613,14 +613,14 @@ bool UiElement::GetRayDistance(const gfx::Point3F& ray_origin,

void UiElement::NotifyClientFloatAnimated(float value,
int target_property_id,
cc::KeyframeModel* animation) {
cc::KeyframeModel* keyframe_model) {
opacity_ = base::ClampToRange(value, 0.0f, 1.0f);
}

void UiElement::NotifyClientTransformOperationsAnimated(
const cc::TransformOperations& operations,
int target_property_id,
cc::KeyframeModel* animation) {
cc::KeyframeModel* keyframe_model) {
if (target_property_id == TRANSFORM) {
transform_operations_ = operations;
} else if (target_property_id == LAYOUT_OFFSET) {
Expand All @@ -632,7 +632,7 @@ void UiElement::NotifyClientTransformOperationsAnimated(

void UiElement::NotifyClientSizeAnimated(const gfx::SizeF& size,
int target_property_id,
cc::KeyframeModel* animation) {
cc::KeyframeModel* keyframe_model) {
size_ = size;
}

Expand All @@ -646,12 +646,13 @@ void UiElement::SetTransitionDuration(base::TimeDelta delta) {
animation_player_.SetTransitionDuration(delta);
}

void UiElement::AddKeyframeModel(std::unique_ptr<cc::KeyframeModel> animation) {
animation_player_.AddKeyframeModel(std::move(animation));
void UiElement::AddKeyframeModel(
std::unique_ptr<cc::KeyframeModel> keyframe_model) {
animation_player_.AddKeyframeModel(std::move(keyframe_model));
}

void UiElement::RemoveKeyframeModel(int animation_id) {
animation_player_.RemoveKeyframeModel(animation_id);
void UiElement::RemoveKeyframeModel(int keyframe_model_id) {
animation_player_.RemoveKeyframeModel(keyframe_model_id);
}

bool UiElement::IsAnimatingProperty(TargetProperty property) const {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ class PLATFORM_EXPORT CompositorKeyframeModel {
const blink::CompositorAnimationCurve& curve,
CompositorTargetProperty::Type target,
int group_id,
int animation_id) {
return WTF::WrapUnique(
new CompositorKeyframeModel(curve, target, animation_id, group_id));
int keyframe_model_id) {
return WTF::WrapUnique(new CompositorKeyframeModel(
curve, target, keyframe_model_id, group_id));
}

~CompositorKeyframeModel();
Expand Down Expand Up @@ -77,7 +77,7 @@ class PLATFORM_EXPORT CompositorKeyframeModel {
private:
CompositorKeyframeModel(const CompositorAnimationCurve&,
CompositorTargetProperty::Type,
int animation_id,
int keyframe_model_id,
int group_id);

std::unique_ptr<cc::KeyframeModel> keyframe_model_;
Expand Down
4 changes: 2 additions & 2 deletions ui/compositor/test/test_layer_animation_delegate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,9 @@ void TestLayerAnimationDelegate::CreateCcLayer() {
}

void TestLayerThreadedAnimationDelegate::AddThreadedAnimation(
std::unique_ptr<cc::KeyframeModel> animation) {}
std::unique_ptr<cc::KeyframeModel> keyframe_model) {}

void TestLayerThreadedAnimationDelegate::RemoveThreadedAnimation(
int animation_id) {}
int keyframe_model_id) {}

} // namespace ui
4 changes: 2 additions & 2 deletions ui/compositor/test/test_layer_animation_delegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ class TestLayerThreadedAnimationDelegate

// Implementation of LayerThreadedAnimationDelegate
void AddThreadedAnimation(
std::unique_ptr<cc::KeyframeModel> animation) override;
void RemoveThreadedAnimation(int animation_id) override;
std::unique_ptr<cc::KeyframeModel> keyframe_model) override;
void RemoveThreadedAnimation(int keyframe_model_id) override;
};

class TestLayerAnimationDelegate : public LayerAnimationDelegate {
Expand Down

0 comments on commit f1fe859

Please sign in to comment.