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