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 19 matching lines...) Expand all Loading... | |
30 | 30 |
31 #include "config.h" | 31 #include "config.h" |
32 #include "core/animation/AnimationTimeline.h" | 32 #include "core/animation/AnimationTimeline.h" |
33 | 33 |
34 #include "core/animation/AnimationClock.h" | 34 #include "core/animation/AnimationClock.h" |
35 #include "core/animation/ElementAnimations.h" | 35 #include "core/animation/ElementAnimations.h" |
36 #include "core/dom/Document.h" | 36 #include "core/dom/Document.h" |
37 #include "core/frame/FrameView.h" | 37 #include "core/frame/FrameView.h" |
38 #include "core/loader/DocumentLoader.h" | 38 #include "core/loader/DocumentLoader.h" |
39 #include "core/page/Page.h" | 39 #include "core/page/Page.h" |
40 #include "platform/RuntimeEnabledFeatures.h" | |
40 #include "platform/TraceEvent.h" | 41 #include "platform/TraceEvent.h" |
42 #include "public/platform/Platform.h" | |
43 #include "public/platform/WebCompositorAnimationTimeline.h" | |
44 #include "public/platform/WebCompositorSupport.h" | |
41 | 45 |
42 namespace blink { | 46 namespace blink { |
43 | 47 |
44 namespace { | 48 namespace { |
45 | 49 |
46 bool compareAnimationPlayers(const RefPtrWillBeMember<blink::AnimationPlayer>& l eft, const RefPtrWillBeMember<blink::AnimationPlayer>& right) | 50 bool compareAnimationPlayers(const RefPtrWillBeMember<blink::AnimationPlayer>& l eft, const RefPtrWillBeMember<blink::AnimationPlayer>& right) |
47 { | 51 { |
48 return AnimationPlayer::hasLowerPriority(left.get(), right.get()); | 52 return AnimationPlayer::hasLowerPriority(left.get(), right.get()); |
49 } | 53 } |
50 | 54 |
(...skipping 14 matching lines...) Expand all Loading... | |
65 , m_zeroTime(0) // 0 is used by unit tests which cannot initialize from the loader | 69 , m_zeroTime(0) // 0 is used by unit tests which cannot initialize from the loader |
66 , m_zeroTimeInitialized(false) | 70 , m_zeroTimeInitialized(false) |
67 , m_playbackRate(1) | 71 , m_playbackRate(1) |
68 , m_lastCurrentTimeInternal(0) | 72 , m_lastCurrentTimeInternal(0) |
69 { | 73 { |
70 if (!timing) | 74 if (!timing) |
71 m_timing = adoptPtrWillBeNoop(new AnimationTimelineTiming(this)); | 75 m_timing = adoptPtrWillBeNoop(new AnimationTimelineTiming(this)); |
72 else | 76 else |
73 m_timing = timing; | 77 m_timing = timing; |
74 | 78 |
79 if (Platform::current()->compositorSupport() && RuntimeEnabledFeatures::comp ositorAnimationTimelinesEnabled()) | |
80 m_compositorTimeline = adoptPtr(Platform::current()->compositorSupport() ->createAnimationTimeline()); | |
81 | |
75 ASSERT(document); | 82 ASSERT(document); |
76 } | 83 } |
77 | 84 |
78 AnimationTimeline::~AnimationTimeline() | 85 AnimationTimeline::~AnimationTimeline() |
79 { | 86 { |
80 #if !ENABLE(OILPAN) | 87 #if !ENABLE(OILPAN) |
81 for (const auto& player : m_players) | 88 for (const auto& player : m_players) |
82 player->timelineDestroyed(); | 89 player->timelineDestroyed(); |
83 #endif | 90 #endif |
84 } | 91 } |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
152 timeToNextEffect = std::min(timeToNextEffect, player->timeToEffectChange ()); | 159 timeToNextEffect = std::min(timeToNextEffect, player->timeToEffectChange ()); |
153 } | 160 } |
154 | 161 |
155 if (timeToNextEffect < s_minimumDelay) { | 162 if (timeToNextEffect < s_minimumDelay) { |
156 m_timing->serviceOnNextFrame(); | 163 m_timing->serviceOnNextFrame(); |
157 } else if (timeToNextEffect != std::numeric_limits<double>::infinity()) { | 164 } else if (timeToNextEffect != std::numeric_limits<double>::infinity()) { |
158 m_timing->wakeAfter(timeToNextEffect - s_minimumDelay); | 165 m_timing->wakeAfter(timeToNextEffect - s_minimumDelay); |
159 } | 166 } |
160 } | 167 } |
161 | 168 |
169 void AnimationTimeline::updateCompositedLayersAttachments() | |
170 { | |
171 for (AnimationPlayer* player : m_players) | |
dstockwell
2015/03/26 03:04:39
m_playersNeedingUpdate?
loyso (OOO)
2015/03/30 02:47:19
UPDATE: Not applicable anymore.
| |
172 player->updateCompositedLayersAttachment(); | |
173 } | |
174 | |
162 void AnimationTimeline::AnimationTimelineTiming::wakeAfter(double duration) | 175 void AnimationTimeline::AnimationTimelineTiming::wakeAfter(double duration) |
163 { | 176 { |
164 m_timer.startOneShot(duration, FROM_HERE); | 177 m_timer.startOneShot(duration, FROM_HERE); |
165 } | 178 } |
166 | 179 |
167 void AnimationTimeline::AnimationTimelineTiming::cancelWake() | 180 void AnimationTimeline::AnimationTimelineTiming::cancelWake() |
168 { | 181 { |
169 m_timer.stop(); | 182 m_timer.stop(); |
170 } | 183 } |
171 | 184 |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
312 { | 325 { |
313 #if ENABLE(OILPAN) | 326 #if ENABLE(OILPAN) |
314 visitor->trace(m_document); | 327 visitor->trace(m_document); |
315 visitor->trace(m_timing); | 328 visitor->trace(m_timing); |
316 visitor->trace(m_playersNeedingUpdate); | 329 visitor->trace(m_playersNeedingUpdate); |
317 visitor->trace(m_players); | 330 visitor->trace(m_players); |
318 #endif | 331 #endif |
319 } | 332 } |
320 | 333 |
321 } // namespace | 334 } // namespace |
OLD | NEW |