| 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" | |
| 13 #include "content/common/content_export.h" | 12 #include "content/common/content_export.h" |
| 14 #include "ui/compositor/compositor_vsync_manager.h" | 13 #include "ui/compositor/compositor_vsync_manager.h" |
| 15 | 14 |
| 16 namespace cc { | 15 namespace cc { |
| 17 class SoftwareOutputDevice; | 16 class SoftwareOutputDevice; |
| 17 class SyntheticBeginFrameSource; |
| 18 } | 18 } |
| 19 | 19 |
| 20 namespace display_compositor { | 20 namespace display_compositor { |
| 21 class CompositorOverlayCandidateValidator; | 21 class CompositorOverlayCandidateValidator; |
| 22 } | 22 } |
| 23 | 23 |
| 24 namespace gfx { | 24 namespace gfx { |
| 25 enum class SwapResult; | 25 enum class SwapResult; |
| 26 } | 26 } |
| 27 | 27 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 // browser process. | 67 // browser process. |
| 68 virtual void OnGpuSwapBuffersCompleted( | 68 virtual void OnGpuSwapBuffersCompleted( |
| 69 const std::vector<ui::LatencyInfo>& latency_info, | 69 const std::vector<ui::LatencyInfo>& latency_info, |
| 70 gfx::SwapResult result, | 70 gfx::SwapResult result, |
| 71 const gpu::GpuProcessHostedCALayerTreeParamsMac* params_mac) = 0; | 71 const gpu::GpuProcessHostedCALayerTreeParamsMac* params_mac) = 0; |
| 72 | 72 |
| 73 #if defined(OS_MACOSX) | 73 #if defined(OS_MACOSX) |
| 74 virtual void SetSurfaceSuspendedForRecycle(bool suspended) = 0; | 74 virtual void SetSurfaceSuspendedForRecycle(bool suspended) = 0; |
| 75 #endif | 75 #endif |
| 76 | 76 |
| 77 cc::SyntheticBeginFrameSource* begin_frame_source() { | |
| 78 return synthetic_begin_frame_source_.get(); | |
| 79 } | |
| 80 | |
| 81 protected: | 77 protected: |
| 82 // Constructor used by the accelerated implementation. | 78 // Constructor used by the accelerated implementation. |
| 83 BrowserCompositorOutputSurface( | 79 BrowserCompositorOutputSurface( |
| 84 scoped_refptr<cc::ContextProvider> context, | 80 scoped_refptr<cc::ContextProvider> context, |
| 85 scoped_refptr<ui::CompositorVSyncManager> vsync_manager, | 81 scoped_refptr<ui::CompositorVSyncManager> vsync_manager, |
| 86 base::SingleThreadTaskRunner* task_runner, | 82 cc::SyntheticBeginFrameSource* begin_frame_source, |
| 87 std::unique_ptr<display_compositor::CompositorOverlayCandidateValidator> | 83 std::unique_ptr<display_compositor::CompositorOverlayCandidateValidator> |
| 88 overlay_candidate_validator); | 84 overlay_candidate_validator); |
| 89 | 85 |
| 90 // Constructor used by the software implementation. | 86 // Constructor used by the software implementation. |
| 91 BrowserCompositorOutputSurface( | 87 BrowserCompositorOutputSurface( |
| 92 std::unique_ptr<cc::SoftwareOutputDevice> software_device, | 88 std::unique_ptr<cc::SoftwareOutputDevice> software_device, |
| 93 const scoped_refptr<ui::CompositorVSyncManager>& vsync_manager, | 89 const scoped_refptr<ui::CompositorVSyncManager>& vsync_manager, |
| 94 base::SingleThreadTaskRunner* task_runner); | 90 cc::SyntheticBeginFrameSource* begin_frame_source); |
| 95 | 91 |
| 96 // Constructor used by the Vulkan implementation. | 92 // Constructor used by the Vulkan implementation. |
| 97 BrowserCompositorOutputSurface( | 93 BrowserCompositorOutputSurface( |
| 98 const scoped_refptr<cc::VulkanContextProvider>& vulkan_context_provider, | 94 const scoped_refptr<cc::VulkanContextProvider>& vulkan_context_provider, |
| 99 const scoped_refptr<ui::CompositorVSyncManager>& vsync_manager, | 95 const scoped_refptr<ui::CompositorVSyncManager>& vsync_manager, |
| 100 base::SingleThreadTaskRunner* task_runner); | 96 cc::SyntheticBeginFrameSource* begin_frame_source); |
| 101 | 97 |
| 102 scoped_refptr<ui::CompositorVSyncManager> vsync_manager_; | 98 scoped_refptr<ui::CompositorVSyncManager> vsync_manager_; |
| 103 std::unique_ptr<cc::SyntheticBeginFrameSource> synthetic_begin_frame_source_; | 99 cc::SyntheticBeginFrameSource* synthetic_begin_frame_source_; |
| 104 ReflectorImpl* reflector_; | 100 ReflectorImpl* reflector_; |
| 105 | 101 |
| 106 // True when BeginFrame scheduling is enabled. | 102 // True when BeginFrame scheduling is enabled. |
| 107 bool use_begin_frame_scheduling_; | 103 bool use_begin_frame_scheduling_; |
| 108 | 104 |
| 109 private: | 105 private: |
| 110 void Initialize(); | 106 void Initialize(); |
| 111 | 107 |
| 112 void UpdateVSyncParametersInternal(base::TimeTicks timebase, | 108 void UpdateVSyncParametersInternal(base::TimeTicks timebase, |
| 113 base::TimeDelta interval); | 109 base::TimeDelta interval); |
| 114 | 110 |
| 115 std::unique_ptr<display_compositor::CompositorOverlayCandidateValidator> | 111 std::unique_ptr<display_compositor::CompositorOverlayCandidateValidator> |
| 116 overlay_candidate_validator_; | 112 overlay_candidate_validator_; |
| 117 | 113 |
| 118 DISALLOW_COPY_AND_ASSIGN(BrowserCompositorOutputSurface); | 114 DISALLOW_COPY_AND_ASSIGN(BrowserCompositorOutputSurface); |
| 119 }; | 115 }; |
| 120 | 116 |
| 121 } // namespace content | 117 } // namespace content |
| 122 | 118 |
| 123 #endif // CONTENT_BROWSER_COMPOSITOR_BROWSER_COMPOSITOR_OUTPUT_SURFACE_H_ | 119 #endif // CONTENT_BROWSER_COMPOSITOR_BROWSER_COMPOSITOR_OUTPUT_SURFACE_H_ |
| OLD | NEW |