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 27 matching lines...) Expand all Loading... |
38 #include "core/animation/ElementAnimations.h" | 38 #include "core/animation/ElementAnimations.h" |
39 #include "core/animation/Interpolation.h" | 39 #include "core/animation/Interpolation.h" |
40 #include "core/animation/KeyframeEffectModel.h" | 40 #include "core/animation/KeyframeEffectModel.h" |
41 #include "core/animation/KeyframeEffectOptions.h" | 41 #include "core/animation/KeyframeEffectOptions.h" |
42 #include "core/animation/PropertyHandle.h" | 42 #include "core/animation/PropertyHandle.h" |
43 #include "core/dom/Element.h" | 43 #include "core/dom/Element.h" |
44 #include "core/dom/NodeComputedStyle.h" | 44 #include "core/dom/NodeComputedStyle.h" |
45 #include "core/frame/UseCounter.h" | 45 #include "core/frame/UseCounter.h" |
46 #include "core/paint/PaintLayer.h" | 46 #include "core/paint/PaintLayer.h" |
47 #include "core/svg/SVGElement.h" | 47 #include "core/svg/SVGElement.h" |
| 48 #include "platform/animation/CompositorAnimationPlayer.h" |
48 | 49 |
49 namespace blink { | 50 namespace blink { |
50 | 51 |
51 KeyframeEffect* KeyframeEffect::create(Element* target, EffectModel* model, cons
t Timing& timing, Priority priority, EventDelegate* eventDelegate) | 52 KeyframeEffect* KeyframeEffect::create(Element* target, EffectModel* model, cons
t Timing& timing, Priority priority, EventDelegate* eventDelegate) |
52 { | 53 { |
53 return new KeyframeEffect(target, model, timing, priority, eventDelegate); | 54 return new KeyframeEffect(target, model, timing, priority, eventDelegate); |
54 } | 55 } |
55 | 56 |
56 KeyframeEffect* KeyframeEffect::create(ExecutionContext* executionContext, Eleme
nt* element, const EffectModelOrDictionarySequenceOrDictionary& effectInput, dou
ble duration, ExceptionState& exceptionState) | 57 KeyframeEffect* KeyframeEffect::create(ExecutionContext* executionContext, Eleme
nt* element, const EffectModelOrDictionarySequenceOrDictionary& effectInput, dou
ble duration, ExceptionState& exceptionState) |
57 { | 58 { |
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
347 void KeyframeEffect::pauseAnimationForTestingOnCompositor(double pauseTime) | 348 void KeyframeEffect::pauseAnimationForTestingOnCompositor(double pauseTime) |
348 { | 349 { |
349 ASSERT(hasActiveAnimationsOnCompositor()); | 350 ASSERT(hasActiveAnimationsOnCompositor()); |
350 if (!m_target || !m_target->layoutObject()) | 351 if (!m_target || !m_target->layoutObject()) |
351 return; | 352 return; |
352 ASSERT(animation()); | 353 ASSERT(animation()); |
353 for (const auto& compositorAnimationId : m_compositorAnimationIds) | 354 for (const auto& compositorAnimationId : m_compositorAnimationIds) |
354 CompositorAnimations::instance()->pauseAnimationForTestingOnCompositor(*
m_target, *animation(), compositorAnimationId, pauseTime); | 355 CompositorAnimations::instance()->pauseAnimationForTestingOnCompositor(*
m_target, *animation(), compositorAnimationId, pauseTime); |
355 } | 356 } |
356 | 357 |
357 bool KeyframeEffect::canAttachCompositedLayers() const | 358 bool KeyframeEffect::canAttachCompositorPlayerToElement() const |
358 { | 359 { |
359 if (!m_target || !animation()) | 360 return m_target && animation() && animation()->compositorPlayer(); |
360 return false; | |
361 | |
362 return CompositorAnimations::instance()->canAttachCompositedLayers(*m_target
, *animation()); | |
363 } | 361 } |
364 | 362 |
365 void KeyframeEffect::attachCompositedLayers() | 363 void KeyframeEffect::attachCompositorPlayerToElement() |
366 { | 364 { |
367 ASSERT(m_target); | 365 ASSERT(m_target); |
368 ASSERT(animation()); | 366 ASSERT(animation()); |
369 CompositorAnimations::instance()->attachCompositedLayers(*m_target, *animati
on()); | 367 ASSERT(animation()->compositorPlayer()); |
| 368 animation()->compositorPlayer()->attachElement(m_target->compositorElementId
()); |
370 } | 369 } |
371 | 370 |
372 DEFINE_TRACE(KeyframeEffect) | 371 DEFINE_TRACE(KeyframeEffect) |
373 { | 372 { |
374 visitor->trace(m_target); | 373 visitor->trace(m_target); |
375 visitor->trace(m_model); | 374 visitor->trace(m_model); |
376 visitor->trace(m_sampledEffect); | 375 visitor->trace(m_sampledEffect); |
377 AnimationEffect::trace(visitor); | 376 AnimationEffect::trace(visitor); |
378 } | 377 } |
379 | 378 |
380 } // namespace blink | 379 } // namespace blink |
OLD | NEW |