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 "cc/scheduler/begin_frame_source.h" |
13 #include "content/common/content_export.h" | 13 #include "content/common/content_export.h" |
14 #include "ui/compositor/compositor_vsync_manager.h" | 14 #include "ui/compositor/compositor_vsync_manager.h" |
15 | 15 |
16 namespace cc { | 16 namespace cc { |
17 class SoftwareOutputDevice; | 17 class SoftwareOutputDevice; |
18 } | 18 } |
19 | 19 |
| 20 namespace display_compositor { |
| 21 class CompositorOverlayCandidateValidator; |
| 22 } |
| 23 |
20 namespace gfx { | 24 namespace gfx { |
21 enum class SwapResult; | 25 enum class SwapResult; |
22 } | 26 } |
23 | 27 |
24 namespace content { | 28 namespace content { |
25 class BrowserCompositorOverlayCandidateValidator; | |
26 class ContextProviderCommandBuffer; | 29 class ContextProviderCommandBuffer; |
27 class ReflectorImpl; | 30 class ReflectorImpl; |
28 class WebGraphicsContext3DCommandBufferImpl; | 31 class WebGraphicsContext3DCommandBufferImpl; |
29 | 32 |
30 class CONTENT_EXPORT BrowserCompositorOutputSurface | 33 class CONTENT_EXPORT BrowserCompositorOutputSurface |
31 : public cc::OutputSurface, | 34 : public cc::OutputSurface, |
32 public ui::CompositorVSyncManager::Observer { | 35 public ui::CompositorVSyncManager::Observer { |
33 public: | 36 public: |
34 ~BrowserCompositorOutputSurface() override; | 37 ~BrowserCompositorOutputSurface() override; |
35 | 38 |
(...skipping 27 matching lines...) Expand all Loading... |
63 virtual bool SurfaceShouldNotShowFramesAfterSuspendForRecycle() const = 0; | 66 virtual bool SurfaceShouldNotShowFramesAfterSuspendForRecycle() const = 0; |
64 #endif | 67 #endif |
65 | 68 |
66 protected: | 69 protected: |
67 // Constructor used by the accelerated implementation. | 70 // Constructor used by the accelerated implementation. |
68 BrowserCompositorOutputSurface( | 71 BrowserCompositorOutputSurface( |
69 const scoped_refptr<cc::ContextProvider>& context, | 72 const scoped_refptr<cc::ContextProvider>& context, |
70 const scoped_refptr<cc::ContextProvider>& worker_context, | 73 const scoped_refptr<cc::ContextProvider>& worker_context, |
71 const scoped_refptr<ui::CompositorVSyncManager>& vsync_manager, | 74 const scoped_refptr<ui::CompositorVSyncManager>& vsync_manager, |
72 base::SingleThreadTaskRunner* task_runner, | 75 base::SingleThreadTaskRunner* task_runner, |
73 std::unique_ptr<BrowserCompositorOverlayCandidateValidator> | 76 std::unique_ptr<display_compositor::CompositorOverlayCandidateValidator> |
74 overlay_candidate_validator); | 77 overlay_candidate_validator); |
75 | 78 |
76 // Constructor used by the software implementation. | 79 // Constructor used by the software implementation. |
77 BrowserCompositorOutputSurface( | 80 BrowserCompositorOutputSurface( |
78 std::unique_ptr<cc::SoftwareOutputDevice> software_device, | 81 std::unique_ptr<cc::SoftwareOutputDevice> software_device, |
79 const scoped_refptr<ui::CompositorVSyncManager>& vsync_manager, | 82 const scoped_refptr<ui::CompositorVSyncManager>& vsync_manager, |
80 base::SingleThreadTaskRunner* task_runner); | 83 base::SingleThreadTaskRunner* task_runner); |
81 | 84 |
82 // Constructor used by the Vulkan implementation. | 85 // Constructor used by the Vulkan implementation. |
83 BrowserCompositorOutputSurface( | 86 BrowserCompositorOutputSurface( |
84 const scoped_refptr<cc::VulkanContextProvider>& vulkan_context_provider, | 87 const scoped_refptr<cc::VulkanContextProvider>& vulkan_context_provider, |
85 const scoped_refptr<ui::CompositorVSyncManager>& vsync_manager, | 88 const scoped_refptr<ui::CompositorVSyncManager>& vsync_manager, |
86 base::SingleThreadTaskRunner* task_runner); | 89 base::SingleThreadTaskRunner* task_runner); |
87 | 90 |
88 scoped_refptr<ui::CompositorVSyncManager> vsync_manager_; | 91 scoped_refptr<ui::CompositorVSyncManager> vsync_manager_; |
89 std::unique_ptr<cc::SyntheticBeginFrameSource> synthetic_begin_frame_source_; | 92 std::unique_ptr<cc::SyntheticBeginFrameSource> synthetic_begin_frame_source_; |
90 ReflectorImpl* reflector_; | 93 ReflectorImpl* reflector_; |
91 | 94 |
92 // True when BeginFrame scheduling is enabled. | 95 // True when BeginFrame scheduling is enabled. |
93 bool use_begin_frame_scheduling_; | 96 bool use_begin_frame_scheduling_; |
94 | 97 |
95 private: | 98 private: |
96 void Initialize(); | 99 void Initialize(); |
97 | 100 |
98 void UpdateVSyncParametersInternal(base::TimeTicks timebase, | 101 void UpdateVSyncParametersInternal(base::TimeTicks timebase, |
99 base::TimeDelta interval); | 102 base::TimeDelta interval); |
100 | 103 |
101 std::unique_ptr<BrowserCompositorOverlayCandidateValidator> | 104 std::unique_ptr<display_compositor::CompositorOverlayCandidateValidator> |
102 overlay_candidate_validator_; | 105 overlay_candidate_validator_; |
103 | 106 |
104 DISALLOW_COPY_AND_ASSIGN(BrowserCompositorOutputSurface); | 107 DISALLOW_COPY_AND_ASSIGN(BrowserCompositorOutputSurface); |
105 }; | 108 }; |
106 | 109 |
107 } // namespace content | 110 } // namespace content |
108 | 111 |
109 #endif // CONTENT_BROWSER_COMPOSITOR_BROWSER_COMPOSITOR_OUTPUT_SURFACE_H_ | 112 #endif // CONTENT_BROWSER_COMPOSITOR_BROWSER_COMPOSITOR_OUTPUT_SURFACE_H_ |
OLD | NEW |