Commit bb01a925 authored by a.renevier's avatar a.renevier Committed by Commit bot

remove WEB_ANIMATION_SUPPORTS_FULL_DIRECTION guards

This is the 3rd part accelerated direction control.

The legacy code was handling alternatesdirection instead of the full set
of direction controls.

Now that blink side has landed, we can remove this legacy code.

It builds on top of https://codereview.chromium.org/227733004 and
https://codereview.chromium.org/225183014

BUG=348071

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

Cr-Commit-Position: refs/heads/master@{#294965}
parent c89745a8
......@@ -114,7 +114,6 @@ void WebCompositorAnimationImpl::setTimeOffset(double monotonic_time) {
animation_->set_time_offset(base::TimeDelta::FromSecondsD(monotonic_time));
}
#if WEB_ANIMATION_SUPPORTS_FULL_DIRECTION
blink::WebCompositorAnimation::Direction WebCompositorAnimationImpl::direction()
const {
switch (animation_->direction()) {
......@@ -148,18 +147,6 @@ void WebCompositorAnimationImpl::setDirection(Direction direction) {
break;
}
}
#else
bool WebCompositorAnimationImpl::alternatesDirection() const {
return animation_->direction() == cc::Animation::Alternate;
}
void WebCompositorAnimationImpl::setAlternatesDirection(bool alternates) {
if (alternates)
animation_->set_direction(cc::Animation::Alternate);
else
animation_->set_direction(cc::Animation::Normal);
}
#endif
double WebCompositorAnimationImpl::playbackRate() const {
return animation_->playback_rate();
......
......@@ -42,13 +42,8 @@ class WebCompositorAnimationImpl : public blink::WebCompositorAnimation {
virtual void setStartTime(double monotonic_time);
virtual double timeOffset() const;
virtual void setTimeOffset(double monotonic_time);
#if WEB_ANIMATION_SUPPORTS_FULL_DIRECTION
virtual Direction direction() const;
virtual void setDirection(Direction);
#else
virtual bool alternatesDirection() const;
virtual void setAlternatesDirection(bool alternates);
#endif
virtual double playbackRate() const;
virtual void setPlaybackRate(double playback_rate);
......
......@@ -24,11 +24,7 @@ TEST(WebCompositorAnimationTest, DefaultSettings) {
EXPECT_EQ(1, animation->iterations());
EXPECT_EQ(0, animation->startTime());
EXPECT_EQ(0, animation->timeOffset());
#if WEB_ANIMATION_SUPPORTS_FULL_DIRECTION
EXPECT_EQ(WebCompositorAnimation::DirectionNormal, animation->direction());
#else
EXPECT_FALSE(animation->alternatesDirection());
#endif
}
TEST(WebCompositorAnimationTest, ModifiedSettings) {
......@@ -38,22 +34,12 @@ TEST(WebCompositorAnimationTest, ModifiedSettings) {
animation->setIterations(2);
animation->setStartTime(2);
animation->setTimeOffset(2);
#if WEB_ANIMATION_SUPPORTS_FULL_DIRECTION
animation->setDirection(WebCompositorAnimation::DirectionReverse);
#else
animation->setAlternatesDirection(true);
#endif
EXPECT_EQ(2, animation->iterations());
EXPECT_EQ(2, animation->startTime());
EXPECT_EQ(2, animation->timeOffset());
#if WEB_ANIMATION_SUPPORTS_FULL_DIRECTION
EXPECT_EQ(WebCompositorAnimation::DirectionReverse, animation->direction());
#else
EXPECT_TRUE(animation->alternatesDirection());
animation->setAlternatesDirection(false);
EXPECT_FALSE(animation->alternatesDirection());
#endif
}
} // namespace
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment