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_COMPOSITOR_BROWSER_COMPOSITOR_OUTPUT_SURFACE_H_ | 5 #ifndef CONTENT_BROWSER_COMPOSITOR_BROWSER_COMPOSITOR_OUTPUT_SURFACE_H_ |
6 #define CONTENT_BROWSER_COMPOSITOR_BROWSER_COMPOSITOR_OUTPUT_SURFACE_H_ | 6 #define CONTENT_BROWSER_COMPOSITOR_BROWSER_COMPOSITOR_OUTPUT_SURFACE_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/threading/non_thread_safe.h" | 9 #include "base/threading/non_thread_safe.h" |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
11 #include "cc/output/output_surface.h" | 11 #include "cc/output/output_surface.h" |
| 12 #include "cc/scheduler/begin_frame_source.h" |
12 #include "content/common/content_export.h" | 13 #include "content/common/content_export.h" |
13 #include "ui/compositor/compositor_vsync_manager.h" | 14 #include "ui/compositor/compositor_vsync_manager.h" |
14 | 15 |
15 namespace cc { | 16 namespace cc { |
16 class SoftwareOutputDevice; | 17 class SoftwareOutputDevice; |
17 } | 18 } |
18 | 19 |
19 namespace gfx { | 20 namespace gfx { |
20 enum class SwapResult; | 21 enum class SwapResult; |
21 } | 22 } |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 virtual void SetSurfaceSuspendedForRecycle(bool suspended) = 0; | 62 virtual void SetSurfaceSuspendedForRecycle(bool suspended) = 0; |
62 virtual bool SurfaceShouldNotShowFramesAfterSuspendForRecycle() const = 0; | 63 virtual bool SurfaceShouldNotShowFramesAfterSuspendForRecycle() const = 0; |
63 #endif | 64 #endif |
64 | 65 |
65 protected: | 66 protected: |
66 // Constructor used by the accelerated implementation. | 67 // Constructor used by the accelerated implementation. |
67 BrowserCompositorOutputSurface( | 68 BrowserCompositorOutputSurface( |
68 const scoped_refptr<cc::ContextProvider>& context, | 69 const scoped_refptr<cc::ContextProvider>& context, |
69 const scoped_refptr<cc::ContextProvider>& worker_context, | 70 const scoped_refptr<cc::ContextProvider>& worker_context, |
70 const scoped_refptr<ui::CompositorVSyncManager>& vsync_manager, | 71 const scoped_refptr<ui::CompositorVSyncManager>& vsync_manager, |
| 72 scoped_ptr<cc::SyntheticBeginFrameSource> synthetic_begin_frame_source, |
71 scoped_ptr<BrowserCompositorOverlayCandidateValidator> | 73 scoped_ptr<BrowserCompositorOverlayCandidateValidator> |
72 overlay_candidate_validator); | 74 overlay_candidate_validator); |
73 | 75 |
74 // Constructor used by the software implementation. | 76 // Constructor used by the software implementation. |
75 BrowserCompositorOutputSurface( | 77 BrowserCompositorOutputSurface( |
76 scoped_ptr<cc::SoftwareOutputDevice> software_device, | 78 scoped_ptr<cc::SoftwareOutputDevice> software_device, |
77 const scoped_refptr<ui::CompositorVSyncManager>& vsync_manager); | 79 const scoped_refptr<ui::CompositorVSyncManager>& vsync_manager, |
| 80 scoped_ptr<cc::SyntheticBeginFrameSource> synthetic_begin_frame_source); |
78 | 81 |
79 scoped_refptr<ui::CompositorVSyncManager> vsync_manager_; | 82 scoped_refptr<ui::CompositorVSyncManager> vsync_manager_; |
| 83 scoped_ptr<cc::SyntheticBeginFrameSource> synthetic_begin_frame_source_; |
80 ReflectorImpl* reflector_; | 84 ReflectorImpl* reflector_; |
81 | 85 |
82 // True when BeginFrame scheduling is enabled. | 86 // True when BeginFrame scheduling is enabled. |
83 bool use_begin_frame_scheduling_; | 87 bool use_begin_frame_scheduling_; |
84 | 88 |
85 private: | 89 private: |
86 void Initialize(); | 90 void Initialize(); |
87 | 91 |
| 92 void UpdateVSyncParametersInternal(base::TimeTicks timebase, |
| 93 base::TimeDelta interval); |
| 94 |
88 scoped_ptr<BrowserCompositorOverlayCandidateValidator> | 95 scoped_ptr<BrowserCompositorOverlayCandidateValidator> |
89 overlay_candidate_validator_; | 96 overlay_candidate_validator_; |
90 | 97 |
91 DISALLOW_COPY_AND_ASSIGN(BrowserCompositorOutputSurface); | 98 DISALLOW_COPY_AND_ASSIGN(BrowserCompositorOutputSurface); |
92 }; | 99 }; |
93 | 100 |
94 } // namespace content | 101 } // namespace content |
95 | 102 |
96 #endif // CONTENT_BROWSER_COMPOSITOR_BROWSER_COMPOSITOR_OUTPUT_SURFACE_H_ | 103 #endif // CONTENT_BROWSER_COMPOSITOR_BROWSER_COMPOSITOR_OUTPUT_SURFACE_H_ |
OLD | NEW |