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

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

Issue 2570603002: Fix initialization in MusBrowserCompositorOutputSurface (Closed)
Patch Set: update owners Created 4 years 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
« no previous file with comments | « content/browser/compositor/OWNERS ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/mus_browser_compositor_output_surface.h" 5 #include "content/browser/compositor/mus_browser_compositor_output_surface.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "cc/output/compositor_frame.h" 9 #include "cc/output/compositor_frame.h"
10 #include "cc/output/output_surface_frame.h" 10 #include "cc/output/output_surface_frame.h"
(...skipping 14 matching lines...) Expand all
25 MusBrowserCompositorOutputSurface::MusBrowserCompositorOutputSurface( 25 MusBrowserCompositorOutputSurface::MusBrowserCompositorOutputSurface(
26 ui::Window* window, 26 ui::Window* window,
27 scoped_refptr<ContextProviderCommandBuffer> context, 27 scoped_refptr<ContextProviderCommandBuffer> context,
28 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, 28 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager,
29 const UpdateVSyncParametersCallback& update_vsync_parameters_callback, 29 const UpdateVSyncParametersCallback& update_vsync_parameters_callback,
30 std::unique_ptr<display_compositor::CompositorOverlayCandidateValidator> 30 std::unique_ptr<display_compositor::CompositorOverlayCandidateValidator>
31 overlay_candidate_validator) 31 overlay_candidate_validator)
32 : GpuBrowserCompositorOutputSurface(std::move(context), 32 : GpuBrowserCompositorOutputSurface(std::move(context),
33 update_vsync_parameters_callback, 33 update_vsync_parameters_callback,
34 std::move(overlay_candidate_validator)), 34 std::move(overlay_candidate_validator)),
35 ui_window_(window) { 35 ui_window_(window),
36 window_(nullptr) {
36 ui_compositor_frame_sink_ = ui_window_->RequestCompositorFrameSink( 37 ui_compositor_frame_sink_ = ui_window_->RequestCompositorFrameSink(
37 ui::mojom::CompositorFrameSinkType::DEFAULT, context, 38 ui::mojom::CompositorFrameSinkType::DEFAULT, context,
38 gpu_memory_buffer_manager); 39 gpu_memory_buffer_manager);
39 ui_compositor_frame_sink_->BindToClient(this); 40 ui_compositor_frame_sink_->BindToClient(this);
40 } 41 }
41 42
42 MusBrowserCompositorOutputSurface::MusBrowserCompositorOutputSurface( 43 MusBrowserCompositorOutputSurface::MusBrowserCompositorOutputSurface(
43 aura::Window* window, 44 aura::Window* window,
44 scoped_refptr<ContextProviderCommandBuffer> context, 45 scoped_refptr<ContextProviderCommandBuffer> context,
45 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, 46 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager,
46 const UpdateVSyncParametersCallback& update_vsync_parameters_callback, 47 const UpdateVSyncParametersCallback& update_vsync_parameters_callback,
47 std::unique_ptr<display_compositor::CompositorOverlayCandidateValidator> 48 std::unique_ptr<display_compositor::CompositorOverlayCandidateValidator>
48 overlay_candidate_validator) 49 overlay_candidate_validator)
49 : GpuBrowserCompositorOutputSurface(std::move(context), 50 : GpuBrowserCompositorOutputSurface(std::move(context),
50 update_vsync_parameters_callback, 51 update_vsync_parameters_callback,
51 std::move(overlay_candidate_validator)), 52 std::move(overlay_candidate_validator)),
53 ui_window_(nullptr),
52 window_(window) { 54 window_(window) {
53 aura::WindowPortMus* window_port = aura::WindowPortMus::Get(window_); 55 aura::WindowPortMus* window_port = aura::WindowPortMus::Get(window_);
54 DCHECK(window_port); 56 DCHECK(window_port);
55 compositor_frame_sink_ = window_port->RequestCompositorFrameSink( 57 compositor_frame_sink_ = window_port->RequestCompositorFrameSink(
56 ui::mojom::CompositorFrameSinkType::DEFAULT, context, 58 ui::mojom::CompositorFrameSinkType::DEFAULT, context,
57 gpu_memory_buffer_manager); 59 gpu_memory_buffer_manager);
58 compositor_frame_sink_->BindToClient(this); 60 compositor_frame_sink_->BindToClient(this);
59 } 61 }
60 62
61 MusBrowserCompositorOutputSurface::~MusBrowserCompositorOutputSurface() {} 63 MusBrowserCompositorOutputSurface::~MusBrowserCompositorOutputSurface() {}
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 198
197 const gpu::Mailbox& MusBrowserCompositorOutputSurface::GetMailboxFromResourceId( 199 const gpu::Mailbox& MusBrowserCompositorOutputSurface::GetMailboxFromResourceId(
198 uint32_t id) { 200 uint32_t id) {
199 DCHECK_LT(id, mailboxes_.size()); 201 DCHECK_LT(id, mailboxes_.size());
200 DCHECK(std::find(free_resource_ids_.begin(), free_resource_ids_.end(), id) == 202 DCHECK(std::find(free_resource_ids_.begin(), free_resource_ids_.end(), id) ==
201 free_resource_ids_.end()); 203 free_resource_ids_.end());
202 return mailboxes_[id]; 204 return mailboxes_[id];
203 } 205 }
204 206
205 } // namespace content 207 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/compositor/OWNERS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698