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_ | 5 #ifndef CONTENT_BROWSER_ANDROID_IN_PROCESS_SYNCHRONOUS_COMPOSITOR_EXTERNAL_BEGIN
_FRAME_SOURCE_ |
6 #define CONTENT_BROWSER_ANDROID_IN_PROCESS_SYNCHRONOUS_COMPOSITOR_EXTERNAL_BEGIN
_FRAME_SOURCE_ | 6 #define CONTENT_BROWSER_ANDROID_IN_PROCESS_SYNCHRONOUS_COMPOSITOR_EXTERNAL_BEGIN
_FRAME_SOURCE_ |
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::BeginFrameSourceMixIn { |
19 public: | 19 public: |
20 explicit SynchronousCompositorExternalBeginFrameSource(int routing_id); | 20 explicit SynchronousCompositorExternalBeginFrameSource(int routing_id); |
21 virtual ~SynchronousCompositorExternalBeginFrameSource(); | 21 ~SynchronousCompositorExternalBeginFrameSource() override; |
22 | 22 |
23 void BeginFrame(); | 23 void BeginFrame(); |
24 | 24 |
25 void SetCompositor(SynchronousCompositorImpl* compositor); | 25 void SetCompositor(SynchronousCompositorImpl* compositor); |
26 | 26 |
27 // cc::BeginFrameSourceMixIn implementation. | 27 // cc::BeginFrameSourceMixIn implementation. |
28 void OnNeedsBeginFramesChange(bool needs_begin_frames) override; | 28 void OnNeedsBeginFramesChange(bool needs_begin_frames) override; |
29 void SetClientReady() override; | 29 void SetClientReady() override; |
30 | 30 |
31 private: | 31 private: |
32 bool CalledOnValidThread() const; | 32 bool CalledOnValidThread() const; |
33 | 33 |
34 const int routing_id_; | 34 const int routing_id_; |
35 bool registered_; | 35 bool registered_; |
36 | 36 |
37 // Not owned. This can be null when compositor is gone first than BFS. | 37 // Not owned. This can be null when compositor is gone first than BFS. |
38 SynchronousCompositorImpl* compositor_; | 38 SynchronousCompositorImpl* compositor_; |
39 | 39 |
40 DISALLOW_COPY_AND_ASSIGN(SynchronousCompositorExternalBeginFrameSource); | 40 DISALLOW_COPY_AND_ASSIGN(SynchronousCompositorExternalBeginFrameSource); |
41 }; | 41 }; |
42 | 42 |
43 } // namespace content | 43 } // namespace content |
44 | 44 |
45 #endif // CONTENT_BROWSER_ANDROID_IN_PROCESS_SYNCHRONOUS_COMPOSITOR_EXTERNAL_BE
GIN_FRAME_SOURCE_ | 45 #endif // CONTENT_BROWSER_ANDROID_IN_PROCESS_SYNCHRONOUS_COMPOSITOR_EXTERNAL_BE
GIN_FRAME_SOURCE_ |
OLD | NEW |