Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(278)

Side by Side Diff: content/browser/compositor/browser_compositor_output_surface.cc

Issue 2002303002: Consolidate OutputSurface constructors into GL vs Vulkan. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: outputsurface-constructors: rebase-and-fixcrash Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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"
11 #include "base/location.h" 11 #include "base/location.h"
12 #include "base/strings/string_number_conversions.h" 12 #include "base/strings/string_number_conversions.h"
13 #include "cc/base/switches.h" 13 #include "cc/base/switches.h"
14 #include "cc/output/output_surface_client.h" 14 #include "cc/output/output_surface_client.h"
15 #include "components/display_compositor/compositor_overlay_candidate_validator.h " 15 #include "components/display_compositor/compositor_overlay_candidate_validator.h "
16 #include "content/browser/compositor/reflector_impl.h" 16 #include "content/browser/compositor/reflector_impl.h"
17 #include "content/common/gpu/client/context_provider_command_buffer.h" 17 #include "content/common/gpu/client/context_provider_command_buffer.h"
18 18
19 namespace content { 19 namespace content {
20 20
21 BrowserCompositorOutputSurface::BrowserCompositorOutputSurface( 21 BrowserCompositorOutputSurface::BrowserCompositorOutputSurface(
22 scoped_refptr<cc::ContextProvider> context_provider, 22 scoped_refptr<cc::ContextProvider> context_provider,
23 scoped_refptr<ui::CompositorVSyncManager> vsync_manager, 23 scoped_refptr<ui::CompositorVSyncManager> vsync_manager,
24 base::SingleThreadTaskRunner* task_runner, 24 base::SingleThreadTaskRunner* task_runner,
25 std::unique_ptr<display_compositor::CompositorOverlayCandidateValidator> 25 std::unique_ptr<display_compositor::CompositorOverlayCandidateValidator>
26 overlay_candidate_validator) 26 overlay_candidate_validator)
27 : OutputSurface(std::move(context_provider)), 27 : OutputSurface(std::move(context_provider), nullptr, nullptr),
28 vsync_manager_(std::move(vsync_manager)), 28 vsync_manager_(std::move(vsync_manager)),
29 synthetic_begin_frame_source_(new cc::SyntheticBeginFrameSource( 29 synthetic_begin_frame_source_(new cc::SyntheticBeginFrameSource(
30 task_runner, 30 task_runner,
31 cc::BeginFrameArgs::DefaultInterval())), 31 cc::BeginFrameArgs::DefaultInterval())),
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::kEnableBeginFrameScheduling)) { 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 base::SingleThreadTaskRunner* task_runner) 43 base::SingleThreadTaskRunner* task_runner)
44 : OutputSurface(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_(new cc::SyntheticBeginFrameSource( 46 synthetic_begin_frame_source_(new cc::SyntheticBeginFrameSource(
47 task_runner, 47 task_runner,
48 cc::BeginFrameArgs::DefaultInterval())), 48 cc::BeginFrameArgs::DefaultInterval())),
49 reflector_(nullptr), 49 reflector_(nullptr),
50 use_begin_frame_scheduling_( 50 use_begin_frame_scheduling_(
51 base::CommandLine::ForCurrentProcess()->HasSwitch( 51 base::CommandLine::ForCurrentProcess()->HasSwitch(
52 cc::switches::kEnableBeginFrameScheduling)) { 52 cc::switches::kEnableBeginFrameScheduling)) {
53 Initialize(); 53 Initialize();
54 } 54 }
55 55
56 BrowserCompositorOutputSurface::BrowserCompositorOutputSurface( 56 BrowserCompositorOutputSurface::BrowserCompositorOutputSurface(
57 const scoped_refptr<cc::VulkanContextProvider>& vulkan_context_provider, 57 const scoped_refptr<cc::VulkanContextProvider>& vulkan_context_provider,
58 const scoped_refptr<ui::CompositorVSyncManager>& vsync_manager, 58 const scoped_refptr<ui::CompositorVSyncManager>& vsync_manager,
59 base::SingleThreadTaskRunner* task_runner) 59 base::SingleThreadTaskRunner* task_runner)
60 : OutputSurface(nullptr, nullptr, vulkan_context_provider, nullptr), 60 : OutputSurface(std::move(vulkan_context_provider)),
61 vsync_manager_(vsync_manager), 61 vsync_manager_(vsync_manager),
62 synthetic_begin_frame_source_(new cc::SyntheticBeginFrameSource( 62 synthetic_begin_frame_source_(new cc::SyntheticBeginFrameSource(
63 task_runner, 63 task_runner,
64 cc::BeginFrameArgs::DefaultInterval())), 64 cc::BeginFrameArgs::DefaultInterval())),
65 reflector_(nullptr) { 65 reflector_(nullptr) {
66 Initialize(); 66 Initialize();
67 } 67 }
68 68
69 BrowserCompositorOutputSurface::~BrowserCompositorOutputSurface() { 69 BrowserCompositorOutputSurface::~BrowserCompositorOutputSurface() {
70 if (reflector_) 70 if (reflector_)
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 BrowserCompositorOutputSurface::CreateCompositionStartedCallback() { 145 BrowserCompositorOutputSurface::CreateCompositionStartedCallback() {
146 return base::Closure(); 146 return base::Closure();
147 } 147 }
148 148
149 cc::OverlayCandidateValidator* 149 cc::OverlayCandidateValidator*
150 BrowserCompositorOutputSurface::GetOverlayCandidateValidator() const { 150 BrowserCompositorOutputSurface::GetOverlayCandidateValidator() const {
151 return overlay_candidate_validator_.get(); 151 return overlay_candidate_validator_.get();
152 } 152 }
153 153
154 } // namespace content 154 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698