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