OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 CONTENT_BROWSER_ANDROID_IN_PROCESS_SYNCHRONOUS_COMPOSITOR_EXTERNAL_BEGIN
_FRAME_SOURCE_H_ | 5 #ifndef CONTENT_BROWSER_ANDROID_IN_PROCESS_SYNCHRONOUS_COMPOSITOR_EXTERNAL_BEGIN
_FRAME_SOURCE_H_ |
6 #define CONTENT_BROWSER_ANDROID_IN_PROCESS_SYNCHRONOUS_COMPOSITOR_EXTERNAL_BEGIN
_FRAME_SOURCE_H_ | 6 #define CONTENT_BROWSER_ANDROID_IN_PROCESS_SYNCHRONOUS_COMPOSITOR_EXTERNAL_BEGIN
_FRAME_SOURCE_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "cc/scheduler/begin_frame_source.h" | 10 #include "cc/scheduler/begin_frame_source.h" |
11 | 11 |
12 namespace content { | 12 namespace content { |
13 class SynchronousCompositorImpl; | 13 class SynchronousCompositorImpl; |
14 | 14 |
15 // Make sure that this is initialized and set to compositor before output | 15 // Make sure that this is initialized and set to compositor before output |
16 // surface is bound to compositor. | 16 // surface is bound to compositor. |
17 class SynchronousCompositorExternalBeginFrameSource | 17 class SynchronousCompositorExternalBeginFrameSource |
18 : public cc::BeginFrameSourceMixIn { | 18 : public cc::BeginFrameSourceBase { |
19 public: | 19 public: |
20 explicit SynchronousCompositorExternalBeginFrameSource(int routing_id); | 20 explicit SynchronousCompositorExternalBeginFrameSource(int routing_id); |
21 ~SynchronousCompositorExternalBeginFrameSource() override; | 21 ~SynchronousCompositorExternalBeginFrameSource() override; |
22 | 22 |
23 void BeginFrame(const cc::BeginFrameArgs& args); | 23 void BeginFrame(const cc::BeginFrameArgs& args); |
24 void SetCompositor(SynchronousCompositorImpl* compositor); | 24 void SetCompositor(SynchronousCompositorImpl* compositor); |
25 | 25 |
26 // cc::BeginFrameSourceMixIn implementation. | 26 // cc::BeginFrameSourceBase implementation. |
27 void OnNeedsBeginFramesChange(bool needs_begin_frames) override; | 27 void OnNeedsBeginFramesChange(bool needs_begin_frames) override; |
28 void SetClientReady() override; | 28 void SetClientReady() override; |
29 | 29 |
30 private: | 30 private: |
31 bool CalledOnValidThread() const; | 31 bool CalledOnValidThread() const; |
32 | 32 |
33 const int routing_id_; | 33 const int routing_id_; |
34 bool registered_; | 34 bool registered_; |
35 | 35 |
36 // Not owned. This can be null when compositor is gone first than BFS. | 36 // Not owned. This can be null when compositor is gone first than BFS. |
37 SynchronousCompositorImpl* compositor_; | 37 SynchronousCompositorImpl* compositor_; |
38 | 38 |
39 DISALLOW_COPY_AND_ASSIGN(SynchronousCompositorExternalBeginFrameSource); | 39 DISALLOW_COPY_AND_ASSIGN(SynchronousCompositorExternalBeginFrameSource); |
40 }; | 40 }; |
41 | 41 |
42 } // namespace content | 42 } // namespace content |
43 | 43 |
44 #endif // CONTENT_BROWSER_ANDROID_IN_PROCESS_SYNCHRONOUS_COMPOSITOR_EXTERNAL_BE
GIN_FRAME_SOURCE_H_ | 44 #endif // CONTENT_BROWSER_ANDROID_IN_PROCESS_SYNCHRONOUS_COMPOSITOR_EXTERNAL_BE
GIN_FRAME_SOURCE_H_ |
OLD | NEW |