OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 21 matching lines...) Expand all Loading... |
32 #include "core/animation/CompositorAnimations.h" | 32 #include "core/animation/CompositorAnimations.h" |
33 | 33 |
34 #include "core/animation/ActiveAnimations.h" | 34 #include "core/animation/ActiveAnimations.h" |
35 #include "core/animation/AnimationNode.h" | 35 #include "core/animation/AnimationNode.h" |
36 #include "core/animation/AnimationTranslationUtil.h" | 36 #include "core/animation/AnimationTranslationUtil.h" |
37 #include "core/animation/CompositorAnimationsImpl.h" | 37 #include "core/animation/CompositorAnimationsImpl.h" |
38 #include "core/animation/animatable/AnimatableDouble.h" | 38 #include "core/animation/animatable/AnimatableDouble.h" |
39 #include "core/animation/animatable/AnimatableFilterOperations.h" | 39 #include "core/animation/animatable/AnimatableFilterOperations.h" |
40 #include "core/animation/animatable/AnimatableTransform.h" | 40 #include "core/animation/animatable/AnimatableTransform.h" |
41 #include "core/animation/animatable/AnimatableValue.h" | 41 #include "core/animation/animatable/AnimatableValue.h" |
| 42 #include "core/layout/Layer.h" |
42 #include "core/layout/compositing/CompositedLayerMapping.h" | 43 #include "core/layout/compositing/CompositedLayerMapping.h" |
43 #include "core/rendering/RenderBoxModelObject.h" | 44 #include "core/rendering/RenderBoxModelObject.h" |
44 #include "core/rendering/RenderLayer.h" | |
45 #include "core/rendering/RenderObject.h" | 45 #include "core/rendering/RenderObject.h" |
46 #include "platform/geometry/FloatBox.h" | 46 #include "platform/geometry/FloatBox.h" |
47 #include "public/platform/Platform.h" | 47 #include "public/platform/Platform.h" |
48 #include "public/platform/WebCompositorAnimation.h" | 48 #include "public/platform/WebCompositorAnimation.h" |
49 #include "public/platform/WebCompositorSupport.h" | 49 #include "public/platform/WebCompositorSupport.h" |
50 #include "public/platform/WebFilterAnimationCurve.h" | 50 #include "public/platform/WebFilterAnimationCurve.h" |
51 #include "public/platform/WebFilterKeyframe.h" | 51 #include "public/platform/WebFilterKeyframe.h" |
52 #include "public/platform/WebFloatAnimationCurve.h" | 52 #include "public/platform/WebFloatAnimationCurve.h" |
53 #include "public/platform/WebFloatKeyframe.h" | 53 #include "public/platform/WebFloatKeyframe.h" |
54 #include "public/platform/WebTransformAnimationCurve.h" | 54 #include "public/platform/WebTransformAnimationCurve.h" |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 } | 256 } |
257 | 257 |
258 bool CompositorAnimations::startAnimationOnCompositor(const Element& element, in
t group, double startTime, double timeOffset, const Timing& timing, const Animat
ionPlayer* player, const AnimationEffect& effect, Vector<int>& startedAnimationI
ds, double playerPlaybackRate) | 258 bool CompositorAnimations::startAnimationOnCompositor(const Element& element, in
t group, double startTime, double timeOffset, const Timing& timing, const Animat
ionPlayer* player, const AnimationEffect& effect, Vector<int>& startedAnimationI
ds, double playerPlaybackRate) |
259 { | 259 { |
260 ASSERT(startedAnimationIds.isEmpty()); | 260 ASSERT(startedAnimationIds.isEmpty()); |
261 ASSERT(isCandidateForAnimationOnCompositor(timing, element, player, effect,
playerPlaybackRate)); | 261 ASSERT(isCandidateForAnimationOnCompositor(timing, element, player, effect,
playerPlaybackRate)); |
262 ASSERT(canStartAnimationOnCompositor(element)); | 262 ASSERT(canStartAnimationOnCompositor(element)); |
263 | 263 |
264 const KeyframeEffectModelBase& keyframeEffect = toKeyframeEffectModelBase(ef
fect); | 264 const KeyframeEffectModelBase& keyframeEffect = toKeyframeEffectModelBase(ef
fect); |
265 | 265 |
266 RenderLayer* layer = toRenderBoxModelObject(element.renderer())->layer(); | 266 Layer* layer = toRenderBoxModelObject(element.renderer())->layer(); |
267 ASSERT(layer); | 267 ASSERT(layer); |
268 | 268 |
269 Vector<OwnPtr<WebCompositorAnimation>> animations; | 269 Vector<OwnPtr<WebCompositorAnimation>> animations; |
270 CompositorAnimationsImpl::getAnimationOnCompositor(timing, group, startTime,
timeOffset, keyframeEffect, animations, playerPlaybackRate); | 270 CompositorAnimationsImpl::getAnimationOnCompositor(timing, group, startTime,
timeOffset, keyframeEffect, animations, playerPlaybackRate); |
271 ASSERT(!animations.isEmpty()); | 271 ASSERT(!animations.isEmpty()); |
272 for (auto& animation : animations) { | 272 for (auto& animation : animations) { |
273 int id = animation->id(); | 273 int id = animation->id(); |
274 if (!layer->compositedLayerMapping()->mainGraphicsLayer()->addAnimation(
animation.release())) { | 274 if (!layer->compositedLayerMapping()->mainGraphicsLayer()->addAnimation(
animation.release())) { |
275 // FIXME: We should know ahead of time whether these animations can
be started. | 275 // FIXME: We should know ahead of time whether these animations can
be started. |
276 for (int startedAnimationId : startedAnimationIds) | 276 for (int startedAnimationId : startedAnimationIds) |
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
616 break; | 616 break; |
617 default: | 617 default: |
618 ASSERT_NOT_REACHED(); | 618 ASSERT_NOT_REACHED(); |
619 } | 619 } |
620 animations.append(animation.release()); | 620 animations.append(animation.release()); |
621 } | 621 } |
622 ASSERT(!animations.isEmpty()); | 622 ASSERT(!animations.isEmpty()); |
623 } | 623 } |
624 | 624 |
625 } // namespace blink | 625 } // namespace blink |
OLD | NEW |