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 "platform/PlatformExport.h" | 8 #include "platform/PlatformExport.h" |
9 #include "platform/heap/Handle.h" | 9 #include "platform/heap/Handle.h" |
10 #include "public/platform/WebCompositorMutatorClient.h" | 10 #include "public/platform/WebCompositorMutatorClient.h" |
11 #include "wtf/OwnPtr.h" | 11 #include <memory> |
12 #include "wtf/PassOwnPtr.h" | |
13 | 12 |
14 namespace blink { | 13 namespace blink { |
15 | 14 |
16 class CompositorMutator; | 15 class CompositorMutator; |
17 struct CompositorMutations; | 16 struct CompositorMutations; |
18 class CompositorMutationsTarget; | 17 class CompositorMutationsTarget; |
19 | 18 |
20 class PLATFORM_EXPORT CompositorMutatorClient : public WebCompositorMutatorClien
t { | 19 class PLATFORM_EXPORT CompositorMutatorClient : public WebCompositorMutatorClien
t { |
21 public: | 20 public: |
22 CompositorMutatorClient(CompositorMutator*, CompositorMutationsTarget*); | 21 CompositorMutatorClient(CompositorMutator*, CompositorMutationsTarget*); |
23 virtual ~CompositorMutatorClient(); | 22 virtual ~CompositorMutatorClient(); |
24 | 23 |
25 void setNeedsMutate(); | 24 void setNeedsMutate(); |
26 | 25 |
27 // cc::LayerTreeMutator | 26 // cc::LayerTreeMutator |
28 bool Mutate(base::TimeTicks monotonicTime, cc::LayerTreeImpl*) override; | 27 bool Mutate(base::TimeTicks monotonicTime, cc::LayerTreeImpl*) override; |
29 void SetClient(cc::LayerTreeMutatorClient*) override; | 28 void SetClient(cc::LayerTreeMutatorClient*) override; |
30 base::Closure TakeMutations() override; | 29 base::Closure TakeMutations() override; |
31 | 30 |
32 CompositorMutator* mutator() { return m_mutator.get(); } | 31 CompositorMutator* mutator() { return m_mutator.get(); } |
33 | 32 |
34 void setMutationsForTesting(PassOwnPtr<CompositorMutations>); | 33 void setMutationsForTesting(std::unique_ptr<CompositorMutations>); |
35 private: | 34 private: |
36 cc::LayerTreeMutatorClient* m_client; | 35 cc::LayerTreeMutatorClient* m_client; |
37 CompositorMutationsTarget* m_mutationsTarget; | 36 CompositorMutationsTarget* m_mutationsTarget; |
38 Persistent<CompositorMutator> m_mutator; | 37 Persistent<CompositorMutator> m_mutator; |
39 OwnPtr<CompositorMutations> m_mutations; | 38 std::unique_ptr<CompositorMutations> m_mutations; |
40 }; | 39 }; |
41 | 40 |
42 } // namespace blink | 41 } // namespace blink |
43 | 42 |
44 #endif // CompositorMutatorClient_h | 43 #endif // CompositorMutatorClient_h |
OLD | NEW |