| 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 28 matching lines...) Expand all Loading... |
| 39 #include "core/frame/UseCounter.h" | 39 #include "core/frame/UseCounter.h" |
| 40 #include "core/inspector/InspectorInstrumentation.h" | 40 #include "core/inspector/InspectorInstrumentation.h" |
| 41 #include "core/inspector/InspectorTraceEvents.h" | 41 #include "core/inspector/InspectorTraceEvents.h" |
| 42 #include "platform/RuntimeEnabledFeatures.h" | 42 #include "platform/RuntimeEnabledFeatures.h" |
| 43 #include "platform/TraceEvent.h" | 43 #include "platform/TraceEvent.h" |
| 44 #include "platform/animation/CompositorAnimationPlayer.h" | 44 #include "platform/animation/CompositorAnimationPlayer.h" |
| 45 #include "platform/graphics/CompositorFactory.h" | 45 #include "platform/graphics/CompositorFactory.h" |
| 46 #include "public/platform/Platform.h" | 46 #include "public/platform/Platform.h" |
| 47 #include "public/platform/WebCompositorSupport.h" | 47 #include "public/platform/WebCompositorSupport.h" |
| 48 #include "wtf/MathExtras.h" | 48 #include "wtf/MathExtras.h" |
| 49 #include "wtf/PtrUtil.h" |
| 49 | 50 |
| 50 namespace blink { | 51 namespace blink { |
| 51 | 52 |
| 52 namespace { | 53 namespace { |
| 53 | 54 |
| 54 static unsigned nextSequenceNumber() | 55 static unsigned nextSequenceNumber() |
| 55 { | 56 { |
| 56 static unsigned next = 0; | 57 static unsigned next = 0; |
| 57 return ++next; | 58 return ++next; |
| 58 } | 59 } |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 m_currentTimePending = false; | 288 m_currentTimePending = false; |
| 288 } | 289 } |
| 289 | 290 |
| 290 if (shouldStart) { | 291 if (shouldStart) { |
| 291 m_compositorGroup = compositorGroup; | 292 m_compositorGroup = compositorGroup; |
| 292 if (startOnCompositor) { | 293 if (startOnCompositor) { |
| 293 if (isCandidateForAnimationOnCompositor()) | 294 if (isCandidateForAnimationOnCompositor()) |
| 294 createCompositorPlayer(); | 295 createCompositorPlayer(); |
| 295 | 296 |
| 296 if (maybeStartAnimationOnCompositor()) | 297 if (maybeStartAnimationOnCompositor()) |
| 297 m_compositorState = adoptPtr(new CompositorState(*this)); | 298 m_compositorState = wrapUnique(new CompositorState(*this)); |
| 298 else | 299 else |
| 299 cancelIncompatibleAnimationsOnCompositor(); | 300 cancelIncompatibleAnimationsOnCompositor(); |
| 300 } | 301 } |
| 301 } | 302 } |
| 302 | 303 |
| 303 return true; | 304 return true; |
| 304 } | 305 } |
| 305 | 306 |
| 306 void Animation::postCommit(double timelineTime) | 307 void Animation::postCommit(double timelineTime) |
| 307 { | 308 { |
| (...skipping 588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 896 void Animation::endUpdatingState() | 897 void Animation::endUpdatingState() |
| 897 { | 898 { |
| 898 ASSERT(m_stateIsBeingUpdated); | 899 ASSERT(m_stateIsBeingUpdated); |
| 899 m_stateIsBeingUpdated = false; | 900 m_stateIsBeingUpdated = false; |
| 900 } | 901 } |
| 901 | 902 |
| 902 void Animation::createCompositorPlayer() | 903 void Animation::createCompositorPlayer() |
| 903 { | 904 { |
| 904 if (Platform::current()->isThreadedAnimationEnabled() && !m_compositorPlayer
) { | 905 if (Platform::current()->isThreadedAnimationEnabled() && !m_compositorPlayer
) { |
| 905 ASSERT(Platform::current()->compositorSupport()); | 906 ASSERT(Platform::current()->compositorSupport()); |
| 906 m_compositorPlayer = adoptPtr(CompositorFactory::current().createAnimati
onPlayer()); | 907 m_compositorPlayer = wrapUnique(CompositorFactory::current().createAnima
tionPlayer()); |
| 907 ASSERT(m_compositorPlayer); | 908 ASSERT(m_compositorPlayer); |
| 908 m_compositorPlayer->setAnimationDelegate(this); | 909 m_compositorPlayer->setAnimationDelegate(this); |
| 909 attachCompositorTimeline(); | 910 attachCompositorTimeline(); |
| 910 } | 911 } |
| 911 | 912 |
| 912 attachCompositedLayers(); | 913 attachCompositedLayers(); |
| 913 } | 914 } |
| 914 | 915 |
| 915 void Animation::destroyCompositorPlayer() | 916 void Animation::destroyCompositorPlayer() |
| 916 { | 917 { |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1085 visitor->trace(m_timeline); | 1086 visitor->trace(m_timeline); |
| 1086 visitor->trace(m_pendingFinishedEvent); | 1087 visitor->trace(m_pendingFinishedEvent); |
| 1087 visitor->trace(m_pendingCancelledEvent); | 1088 visitor->trace(m_pendingCancelledEvent); |
| 1088 visitor->trace(m_finishedPromise); | 1089 visitor->trace(m_finishedPromise); |
| 1089 visitor->trace(m_readyPromise); | 1090 visitor->trace(m_readyPromise); |
| 1090 EventTargetWithInlineData::trace(visitor); | 1091 EventTargetWithInlineData::trace(visitor); |
| 1091 ActiveDOMObject::trace(visitor); | 1092 ActiveDOMObject::trace(visitor); |
| 1092 } | 1093 } |
| 1093 | 1094 |
| 1094 } // namespace blink | 1095 } // namespace blink |
| OLD | NEW |