Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1376)

Unified Diff: cc/blink/web_animation_impl.cc

Issue 579863004: CC: Add fill mode to compositor animations (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix compile Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/blink/web_animation_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/blink/web_animation_impl.cc
diff --git a/cc/blink/web_animation_impl.cc b/cc/blink/web_animation_impl.cc
index a819cecb63bf67181c1402d89cf98f53142ae056..f1069c702718fcd5c25d9dc68494a3a89a7e7bb6 100644
--- a/cc/blink/web_animation_impl.cc
+++ b/cc/blink/web_animation_impl.cc
@@ -79,7 +79,6 @@ WebCompositorAnimationImpl::targetProperty() const {
animation_->target_property());
}
-#if WEB_ANIMATION_SUPPORTS_FRACTIONAL_ITERATIONS
double WebCompositorAnimationImpl::iterations() const {
return animation_->iterations();
}
@@ -87,15 +86,6 @@ double WebCompositorAnimationImpl::iterations() const {
void WebCompositorAnimationImpl::setIterations(double n) {
animation_->set_iterations(n);
}
-#else
-int WebCompositorAnimationImpl::iterations() const {
- return animation_->iterations();
-}
-
-void WebCompositorAnimationImpl::setIterations(int n) {
- animation_->set_iterations(n);
-}
-#endif
double WebCompositorAnimationImpl::iterationStart() const {
return animation_->iteration_start();
@@ -164,6 +154,41 @@ void WebCompositorAnimationImpl::setPlaybackRate(double playback_rate) {
animation_->set_playback_rate(playback_rate);
}
+#if WEB_ANIMATION_SUPPORTS_FILL_MODE
+blink::WebCompositorAnimation::FillMode WebCompositorAnimationImpl::fillMode()
+ const {
+ switch (animation_->fill_mode()) {
+ case cc::Animation::FillModeNone:
+ return FillModeNone;
+ case cc::Animation::FillModeForwards:
+ return FillModeForwards;
+ case cc::Animation::FillModeBackwards:
+ return FillModeBackwards;
+ case cc::Animation::FillModeBoth:
+ return FillModeBoth;
+ default:
+ NOTREACHED();
+ }
+ return FillModeNone;
+}
+
+void WebCompositorAnimationImpl::setFillMode(FillMode fill_mode) {
+ switch (fill_mode) {
+ case FillModeNone:
+ animation_->set_fill_mode(cc::Animation::FillModeNone);
+ break;
+ case FillModeForwards:
+ animation_->set_fill_mode(cc::Animation::FillModeForwards);
+ break;
+ case FillModeBackwards:
+ animation_->set_fill_mode(cc::Animation::FillModeBackwards);
+ break;
+ case FillModeBoth:
+ animation_->set_fill_mode(cc::Animation::FillModeBoth);
+ break;
+ }
+}
+#endif
scoped_ptr<cc::Animation> WebCompositorAnimationImpl::PassAnimation() {
animation_->set_needs_synchronized_start_time(true);
return animation_.Pass();
« no previous file with comments | « cc/blink/web_animation_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698