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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 synthetic_begin_frame_source_(new cc::SyntheticBeginFrameSource( | 47 synthetic_begin_frame_source_(new cc::SyntheticBeginFrameSource( |
48 task_runner, | 48 task_runner, |
49 cc::BeginFrameArgs::DefaultInterval())), | 49 cc::BeginFrameArgs::DefaultInterval())), |
50 reflector_(nullptr), | 50 reflector_(nullptr), |
51 use_begin_frame_scheduling_( | 51 use_begin_frame_scheduling_( |
52 base::CommandLine::ForCurrentProcess()->HasSwitch( | 52 base::CommandLine::ForCurrentProcess()->HasSwitch( |
53 cc::switches::kEnableBeginFrameScheduling)) { | 53 cc::switches::kEnableBeginFrameScheduling)) { |
54 Initialize(); | 54 Initialize(); |
55 } | 55 } |
56 | 56 |
| 57 #if defined(ENABLE_VULKAN) |
| 58 BrowserCompositorOutputSurface::BrowserCompositorOutputSurface( |
| 59 const scoped_refptr<cc::VulkanContextProvider>& vulkan_context_provider, |
| 60 const scoped_refptr<ui::CompositorVSyncManager>& vsync_manager) |
| 61 : OutputSurface(vulkan_context_provider, true), |
| 62 vsync_manager_(vsync_manager), |
| 63 reflector_(nullptr) { |
| 64 Initialize(); |
| 65 } |
| 66 #endif |
| 67 |
57 BrowserCompositorOutputSurface::~BrowserCompositorOutputSurface() { | 68 BrowserCompositorOutputSurface::~BrowserCompositorOutputSurface() { |
58 if (reflector_) | 69 if (reflector_) |
59 reflector_->DetachFromOutputSurface(); | 70 reflector_->DetachFromOutputSurface(); |
60 DCHECK(!reflector_); | 71 DCHECK(!reflector_); |
61 if (!HasClient()) | 72 if (!HasClient()) |
62 return; | 73 return; |
63 | 74 |
64 // When BeginFrame scheduling is enabled, vsync info is not routed to renderer | 75 // When BeginFrame scheduling is enabled, vsync info is not routed to renderer |
65 // by using |vsync_manager_|. Instead, BeginFrame message is used. | 76 // by using |vsync_manager_|. Instead, BeginFrame message is used. |
66 if (!use_begin_frame_scheduling_) | 77 if (!use_begin_frame_scheduling_) |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 BrowserCompositorOutputSurface::CreateCompositionStartedCallback() { | 144 BrowserCompositorOutputSurface::CreateCompositionStartedCallback() { |
134 return base::Closure(); | 145 return base::Closure(); |
135 } | 146 } |
136 | 147 |
137 cc::OverlayCandidateValidator* | 148 cc::OverlayCandidateValidator* |
138 BrowserCompositorOutputSurface::GetOverlayCandidateValidator() const { | 149 BrowserCompositorOutputSurface::GetOverlayCandidateValidator() const { |
139 return overlay_candidate_validator_.get(); | 150 return overlay_candidate_validator_.get(); |
140 } | 151 } |
141 | 152 |
142 } // namespace content | 153 } // namespace content |
OLD | NEW |