| 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 #include "content/browser/compositor/browser_compositor_output_surface.h" | 5 #include "content/browser/compositor/browser_compositor_output_surface.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 scoped_refptr<cc::ContextProvider> context_provider, | 24 scoped_refptr<cc::ContextProvider> context_provider, |
| 25 scoped_refptr<ui::CompositorVSyncManager> vsync_manager, | 25 scoped_refptr<ui::CompositorVSyncManager> vsync_manager, |
| 26 cc::SyntheticBeginFrameSource* begin_frame_source, | 26 cc::SyntheticBeginFrameSource* begin_frame_source, |
| 27 std::unique_ptr<display_compositor::CompositorOverlayCandidateValidator> | 27 std::unique_ptr<display_compositor::CompositorOverlayCandidateValidator> |
| 28 overlay_candidate_validator) | 28 overlay_candidate_validator) |
| 29 : OutputSurface(std::move(context_provider), nullptr, nullptr), | 29 : OutputSurface(std::move(context_provider), nullptr, nullptr), |
| 30 vsync_manager_(std::move(vsync_manager)), | 30 vsync_manager_(std::move(vsync_manager)), |
| 31 synthetic_begin_frame_source_(begin_frame_source), | 31 synthetic_begin_frame_source_(begin_frame_source), |
| 32 reflector_(nullptr), | 32 reflector_(nullptr), |
| 33 use_begin_frame_scheduling_( | 33 use_begin_frame_scheduling_( |
| 34 !base::CommandLine::ForCurrentProcess()->HasSwitch( | 34 base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 35 cc::switches::kDisableBeginFrameScheduling)) { | 35 cc::switches::kEnableBeginFrameScheduling)) { |
| 36 overlay_candidate_validator_ = std::move(overlay_candidate_validator); | 36 overlay_candidate_validator_ = std::move(overlay_candidate_validator); |
| 37 Initialize(); | 37 Initialize(); |
| 38 } | 38 } |
| 39 | 39 |
| 40 BrowserCompositorOutputSurface::BrowserCompositorOutputSurface( | 40 BrowserCompositorOutputSurface::BrowserCompositorOutputSurface( |
| 41 std::unique_ptr<cc::SoftwareOutputDevice> software_device, | 41 std::unique_ptr<cc::SoftwareOutputDevice> software_device, |
| 42 const scoped_refptr<ui::CompositorVSyncManager>& vsync_manager, | 42 const scoped_refptr<ui::CompositorVSyncManager>& vsync_manager, |
| 43 cc::SyntheticBeginFrameSource* begin_frame_source) | 43 cc::SyntheticBeginFrameSource* begin_frame_source) |
| 44 : OutputSurface(nullptr, nullptr, std::move(software_device)), | 44 : OutputSurface(nullptr, nullptr, std::move(software_device)), |
| 45 vsync_manager_(vsync_manager), | 45 vsync_manager_(vsync_manager), |
| 46 synthetic_begin_frame_source_(begin_frame_source), | 46 synthetic_begin_frame_source_(begin_frame_source), |
| 47 reflector_(nullptr), | 47 reflector_(nullptr), |
| 48 use_begin_frame_scheduling_( | 48 use_begin_frame_scheduling_( |
| 49 !base::CommandLine::ForCurrentProcess()->HasSwitch( | 49 base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 50 cc::switches::kDisableBeginFrameScheduling)) { | 50 cc::switches::kEnableBeginFrameScheduling)) { |
| 51 Initialize(); | 51 Initialize(); |
| 52 } | 52 } |
| 53 | 53 |
| 54 BrowserCompositorOutputSurface::BrowserCompositorOutputSurface( | 54 BrowserCompositorOutputSurface::BrowserCompositorOutputSurface( |
| 55 const scoped_refptr<cc::VulkanContextProvider>& vulkan_context_provider, | 55 const scoped_refptr<cc::VulkanContextProvider>& vulkan_context_provider, |
| 56 const scoped_refptr<ui::CompositorVSyncManager>& vsync_manager, | 56 const scoped_refptr<ui::CompositorVSyncManager>& vsync_manager, |
| 57 cc::SyntheticBeginFrameSource* begin_frame_source) | 57 cc::SyntheticBeginFrameSource* begin_frame_source) |
| 58 : OutputSurface(std::move(vulkan_context_provider)), | 58 : OutputSurface(std::move(vulkan_context_provider)), |
| 59 vsync_manager_(vsync_manager), | 59 vsync_manager_(vsync_manager), |
| 60 synthetic_begin_frame_source_(begin_frame_source), | 60 synthetic_begin_frame_source_(begin_frame_source), |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 BrowserCompositorOutputSurface::CreateCompositionStartedCallback() { | 138 BrowserCompositorOutputSurface::CreateCompositionStartedCallback() { |
| 139 return base::Closure(); | 139 return base::Closure(); |
| 140 } | 140 } |
| 141 | 141 |
| 142 cc::OverlayCandidateValidator* | 142 cc::OverlayCandidateValidator* |
| 143 BrowserCompositorOutputSurface::GetOverlayCandidateValidator() const { | 143 BrowserCompositorOutputSurface::GetOverlayCandidateValidator() const { |
| 144 return overlay_candidate_validator_.get(); | 144 return overlay_candidate_validator_.get(); |
| 145 } | 145 } |
| 146 | 146 |
| 147 } // namespace content | 147 } // namespace content |
| OLD | NEW |