| 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 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 345 void KeyframeEffect::pauseAnimationForTestingOnCompositor(double pauseTime) | 346 void KeyframeEffect::pauseAnimationForTestingOnCompositor(double pauseTime) |
| 346 { | 347 { |
| 347 ASSERT(hasActiveAnimationsOnCompositor()); | 348 ASSERT(hasActiveAnimationsOnCompositor()); |
| 348 if (!m_target || !m_target->layoutObject()) | 349 if (!m_target || !m_target->layoutObject()) |
| 349 return; | 350 return; |
| 350 ASSERT(animation()); | 351 ASSERT(animation()); |
| 351 for (const auto& compositorAnimationId : m_compositorAnimationIds) | 352 for (const auto& compositorAnimationId : m_compositorAnimationIds) |
| 352 CompositorAnimations::instance()->pauseAnimationForTestingOnCompositor(*
m_target, *animation(), compositorAnimationId, pauseTime); | 353 CompositorAnimations::instance()->pauseAnimationForTestingOnCompositor(*
m_target, *animation(), compositorAnimationId, pauseTime); |
| 353 } | 354 } |
| 354 | 355 |
| 355 bool KeyframeEffect::canAttachCompositedLayers() const | 356 bool KeyframeEffect::canAttachCompositorPlayerToElement() const |
| 356 { | 357 { |
| 357 if (!m_target || !animation()) | 358 return m_target && animation() && animation()->compositorPlayer(); |
| 358 return false; | |
| 359 | |
| 360 return CompositorAnimations::instance()->canAttachCompositedLayers(*m_target
, *animation()); | |
| 361 } | 359 } |
| 362 | 360 |
| 363 void KeyframeEffect::attachCompositedLayers() | 361 void KeyframeEffect::attachCompositorPlayerToElement() |
| 364 { | 362 { |
| 365 ASSERT(m_target); | 363 ASSERT(m_target); |
| 366 ASSERT(animation()); | 364 ASSERT(animation()); |
| 367 CompositorAnimations::instance()->attachCompositedLayers(*m_target, *animati
on()); | 365 ASSERT(animation()->compositorPlayer()); |
| 366 animation()->compositorPlayer()->attachElement(m_target->compositorElementId
()); |
| 368 } | 367 } |
| 369 | 368 |
| 370 DEFINE_TRACE(KeyframeEffect) | 369 DEFINE_TRACE(KeyframeEffect) |
| 371 { | 370 { |
| 372 visitor->trace(m_target); | 371 visitor->trace(m_target); |
| 373 visitor->trace(m_model); | 372 visitor->trace(m_model); |
| 374 visitor->trace(m_sampledEffect); | 373 visitor->trace(m_sampledEffect); |
| 375 AnimationEffect::trace(visitor); | 374 AnimationEffect::trace(visitor); |
| 376 } | 375 } |
| 377 | 376 |
| 378 } // namespace blink | 377 } // namespace blink |
| OLD | NEW |