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

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

Issue 1892303003: Added the Vulkan Context Provider implementation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Export VulkanContextProvider Created 4 years, 8 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"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 BrowserCompositorOutputSurface::BrowserCompositorOutputSurface(
58 const scoped_refptr<cc::VulkanContextProvider>& vulkan_context_provider,
59 const scoped_refptr<ui::CompositorVSyncManager>& vsync_manager)
60 : OutputSurface(nullptr, nullptr, vulkan_context_provider, nullptr),
61 vsync_manager_(vsync_manager),
62 reflector_(nullptr) {
63 Initialize();
64 }
65
57 BrowserCompositorOutputSurface::~BrowserCompositorOutputSurface() { 66 BrowserCompositorOutputSurface::~BrowserCompositorOutputSurface() {
58 if (reflector_) 67 if (reflector_)
59 reflector_->DetachFromOutputSurface(); 68 reflector_->DetachFromOutputSurface();
60 DCHECK(!reflector_); 69 DCHECK(!reflector_);
61 if (!HasClient()) 70 if (!HasClient())
62 return; 71 return;
63 72
64 // When BeginFrame scheduling is enabled, vsync info is not routed to renderer 73 // When BeginFrame scheduling is enabled, vsync info is not routed to renderer
65 // by using |vsync_manager_|. Instead, BeginFrame message is used. 74 // by using |vsync_manager_|. Instead, BeginFrame message is used.
66 if (!use_begin_frame_scheduling_) 75 if (!use_begin_frame_scheduling_)
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 BrowserCompositorOutputSurface::CreateCompositionStartedCallback() { 142 BrowserCompositorOutputSurface::CreateCompositionStartedCallback() {
134 return base::Closure(); 143 return base::Closure();
135 } 144 }
136 145
137 cc::OverlayCandidateValidator* 146 cc::OverlayCandidateValidator*
138 BrowserCompositorOutputSurface::GetOverlayCandidateValidator() const { 147 BrowserCompositorOutputSurface::GetOverlayCandidateValidator() const {
139 return overlay_candidate_validator_.get(); 148 return overlay_candidate_validator_.get();
140 } 149 }
141 150
142 } // namespace content 151 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698