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/ThreadSafeFunctional.h" | 9 #include "platform/ThreadSafeFunctional.h" |
10 #include "platform/TraceEvent.h" | 10 #include "platform/TraceEvent.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 // it gets used there. We still need to make sure we only create one mutator
though. | 49 // it gets used there. We still need to make sure we only create one mutator
though. |
50 doneEvent.wait(); | 50 doneEvent.wait(); |
51 return mutatorClient; | 51 return mutatorClient; |
52 } | 52 } |
53 | 53 |
54 CompositorMutatorImpl* CompositorMutatorImpl::create() | 54 CompositorMutatorImpl* CompositorMutatorImpl::create() |
55 { | 55 { |
56 return new CompositorMutatorImpl(); | 56 return new CompositorMutatorImpl(); |
57 } | 57 } |
58 | 58 |
59 bool CompositorMutatorImpl::mutate(double monotonicTimeNow) | 59 bool CompositorMutatorImpl::mutate(double monotonicTimeNow, CompositorMutableSta
teProvider* stateProvider) |
60 { | 60 { |
61 TRACE_EVENT0("compositor-worker", "CompositorMutatorImpl::mutate"); | 61 TRACE_EVENT0("compositor-worker", "CompositorMutatorImpl::mutate"); |
62 bool needToReinvoke = false; | 62 bool needToReinvoke = false; |
63 // TODO(vollick): we should avoid executing the animation frame | 63 // TODO(vollick): we should avoid executing the animation frame |
64 // callbacks if none of the proxies in the global scope are affected by | 64 // callbacks if none of the proxies in the global scope are affected by |
65 // m_mutations. | 65 // m_mutations. |
66 for (CompositorProxyClientImpl* client : m_proxyClients) { | 66 for (CompositorProxyClientImpl* client : m_proxyClients) { |
67 if (client->mutate(monotonicTimeNow)) | 67 if (client->mutate(monotonicTimeNow, stateProvider)) |
68 needToReinvoke = true; | 68 needToReinvoke = true; |
69 } | 69 } |
70 | 70 |
71 return needToReinvoke; | 71 return needToReinvoke; |
72 } | 72 } |
73 | 73 |
74 void CompositorMutatorImpl::registerProxyClient(CompositorProxyClientImpl* clien
t) | 74 void CompositorMutatorImpl::registerProxyClient(CompositorProxyClientImpl* clien
t) |
75 { | 75 { |
76 TRACE_EVENT0("compositor-worker", "CompositorMutatorImpl::registerClient"); | 76 TRACE_EVENT0("compositor-worker", "CompositorMutatorImpl::registerClient"); |
77 m_proxyClients.add(client); | 77 m_proxyClients.add(client); |
78 setNeedsMutate(); | 78 setNeedsMutate(); |
79 } | 79 } |
80 | 80 |
81 void CompositorMutatorImpl::setNeedsMutate() | 81 void CompositorMutatorImpl::setNeedsMutate() |
82 { | 82 { |
83 TRACE_EVENT0("compositor-worker", "CompositorMutatorImpl::setNeedsMutate"); | 83 TRACE_EVENT0("compositor-worker", "CompositorMutatorImpl::setNeedsMutate"); |
84 m_client->setNeedsMutate(); | 84 m_client->setNeedsMutate(); |
85 } | 85 } |
86 | 86 |
87 } // namespace blink | 87 } // namespace blink |
OLD | NEW |