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 #ifndef CompositorMutatorClient_h | 5 #ifndef CompositorMutatorClient_h |
6 #define CompositorMutatorClient_h | 6 #define CompositorMutatorClient_h |
7 | 7 |
8 #include <map> | |
9 #include <memory> | |
8 #include "platform/PlatformExport.h" | 10 #include "platform/PlatformExport.h" |
11 #include "platform/graphics/CompositorMutableProperties.h" | |
9 #include "platform/heap/Handle.h" | 12 #include "platform/heap/Handle.h" |
10 #include "public/platform/WebCompositorMutatorClient.h" | 13 #include "public/platform/WebCompositorMutatorClient.h" |
11 #include <memory> | |
12 | 14 |
13 namespace blink { | 15 namespace blink { |
14 | 16 |
15 class CompositorMutator; | 17 class CompositorMutator; |
16 struct CompositorMutations; | 18 struct CompositorMutations; |
17 class CompositorMutationsTarget; | 19 class CompositorMutationsTarget; |
20 class CompositorMutation; | |
18 | 21 |
19 class PLATFORM_EXPORT CompositorMutatorClient | 22 class PLATFORM_EXPORT CompositorMutatorClient |
20 : public WebCompositorMutatorClient { | 23 : public WebCompositorMutatorClient { |
21 public: | 24 public: |
22 CompositorMutatorClient(CompositorMutator*, CompositorMutationsTarget*); | 25 CompositorMutatorClient(CompositorMutator*, CompositorMutationsTarget*); |
23 virtual ~CompositorMutatorClient(); | 26 virtual ~CompositorMutatorClient(); |
24 | 27 |
25 void setNeedsMutate(); | 28 void setNeedsMutate(); |
29 void registerCompositorProxy(uint64_t proxyId, | |
30 uint64_t elementId, | |
31 uint32_t mutableProperties); | |
32 void unregisterCompositorProxy(uint64_t proxyId); | |
26 | 33 |
27 // cc::LayerTreeMutator | 34 // cc::LayerTreeMutator |
28 bool Mutate(base::TimeTicks monotonicTime, cc::LayerTreeImpl*) override; | 35 bool Mutate(base::TimeTicks monotonicTime, cc::LayerTreeImpl*) override; |
29 void SetClient(cc::LayerTreeMutatorClient*) override; | 36 void SetClient(cc::LayerTreeMutatorClient*) override; |
30 base::Closure TakeMutations() override; | 37 base::Closure TakeMutations() override; |
31 | 38 |
32 CompositorMutator* mutator() { return m_mutator.get(); } | 39 CompositorMutator* mutator() { return m_mutator.get(); } |
33 | 40 |
34 void setMutationsForTesting(std::unique_ptr<CompositorMutations>); | 41 void setMutationsForTesting(std::unique_ptr<CompositorMutations>); |
35 | 42 |
36 private: | 43 private: |
44 void snapshotLayerTree(const cc::LayerTreeImpl*, | |
45 ProxyCompositorMutablePropertiesMap*) const; | |
46 void updateLayerTree(cc::LayerTreeImpl*, | |
47 uint64_t elementId, | |
48 const CompositorMutation*) const; | |
49 void updateMutations(uint64_t elementId, std::unique_ptr<CompositorMutation>); | |
50 | |
37 cc::LayerTreeMutatorClient* m_client; | 51 cc::LayerTreeMutatorClient* m_client; |
38 CompositorMutationsTarget* m_mutationsTarget; | 52 CompositorMutationsTarget* m_mutationsTarget; |
53 std::map<uint64_t, std::pair<uint64_t, uint32_t>> m_inputProperties; | |
smcgruer
2017/03/20 14:31:51
What threads access this? I suspect that Composito
Scott Funkenhauser
2017/03/21 19:31:12
It looks like registerCompositorProxy is called on
| |
39 // Accessed by main and compositor threads. | 54 // Accessed by main and compositor threads. |
40 CrossThreadPersistent<CompositorMutator> m_mutator; | 55 CrossThreadPersistent<CompositorMutator> m_mutator; |
41 std::unique_ptr<CompositorMutations> m_mutations; | 56 std::unique_ptr<CompositorMutations> m_mutations; |
42 }; | 57 }; |
43 | 58 |
44 } // namespace blink | 59 } // namespace blink |
45 | 60 |
46 #endif // CompositorMutatorClient_h | 61 #endif // CompositorMutatorClient_h |
OLD | NEW |