| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "web/CompositorMutatorImpl.h" | 5 #include "web/CompositorMutatorImpl.h" |
| 6 | 6 |
| 7 #include "core/animation/CustomCompositorAnimationManager.h" | 7 #include "core/animation/CustomCompositorAnimationManager.h" |
| 8 #include "core/dom/CompositorProxy.h" | 8 #include "core/dom/CompositorProxy.h" |
| 9 #include "platform/CrossThreadFunctional.h" | 9 #include "platform/CrossThreadFunctional.h" |
| 10 #include "platform/WaitableEvent.h" | 10 #include "platform/WaitableEvent.h" |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 for (CompositorAnimator* animator : m_animators) { | 69 for (CompositorAnimator* animator : m_animators) { |
| 70 if (animator->mutate(monotonicTimeNow, stateProvider)) | 70 if (animator->mutate(monotonicTimeNow, stateProvider)) |
| 71 needToReinvoke = true; | 71 needToReinvoke = true; |
| 72 } | 72 } |
| 73 | 73 |
| 74 return needToReinvoke; | 74 return needToReinvoke; |
| 75 } | 75 } |
| 76 | 76 |
| 77 void CompositorMutatorImpl::registerCompositorAnimator( | 77 void CompositorMutatorImpl::registerCompositorAnimator( |
| 78 CompositorAnimator* animator) { | 78 CompositorAnimator* animator) { |
| 79 DCHECK(!isMainThread()); |
| 79 TRACE_EVENT0("compositor-worker", | 80 TRACE_EVENT0("compositor-worker", |
| 80 "CompositorMutatorImpl::registerCompositorAnimator"); | 81 "CompositorMutatorImpl::registerCompositorAnimator"); |
| 81 DCHECK(!m_animators.contains(animator)); | 82 DCHECK(!m_animators.contains(animator)); |
| 82 m_animators.insert(animator); | 83 m_animators.insert(animator); |
| 83 setNeedsMutate(); | 84 setNeedsMutate(); |
| 84 } | 85 } |
| 85 | 86 |
| 86 void CompositorMutatorImpl::unregisterCompositorAnimator( | 87 void CompositorMutatorImpl::unregisterCompositorAnimator( |
| 87 CompositorAnimator* animator) { | 88 CompositorAnimator* animator) { |
| 88 DCHECK(m_animators.contains(animator)); | 89 DCHECK(m_animators.contains(animator)); |
| 89 m_animators.erase(animator); | 90 m_animators.erase(animator); |
| 90 } | 91 } |
| 91 | 92 |
| 92 void CompositorMutatorImpl::setNeedsMutate() { | 93 void CompositorMutatorImpl::setNeedsMutate() { |
| 94 DCHECK(!isMainThread()); |
| 93 TRACE_EVENT0("compositor-worker", "CompositorMutatorImpl::setNeedsMutate"); | 95 TRACE_EVENT0("compositor-worker", "CompositorMutatorImpl::setNeedsMutate"); |
| 94 m_client->setNeedsMutate(); | 96 m_client->setNeedsMutate(); |
| 95 } | 97 } |
| 96 | 98 |
| 97 } // namespace blink | 99 } // namespace blink |
| OLD | NEW |