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

Side by Side Diff: ui/aura/mus/mus_context_factory.cc

Issue 2875753002: Implement aura::WindowPortMus::CreateCompositorFrameSink() (Closed)
Patch Set: Address review issues. Created 3 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "ui/aura/mus/mus_context_factory.h" 5 #include "ui/aura/mus/mus_context_factory.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "cc/base/switches.h" 9 #include "cc/base/switches.h"
10 #include "services/ui/public/cpp/gpu/gpu.h" 10 #include "services/ui/public/cpp/gpu/gpu.h"
(...skipping 21 matching lines...) Expand all
32 void MusContextFactory::OnEstablishedGpuChannel( 32 void MusContextFactory::OnEstablishedGpuChannel(
33 base::WeakPtr<ui::Compositor> compositor, 33 base::WeakPtr<ui::Compositor> compositor,
34 scoped_refptr<gpu::GpuChannelHost> gpu_channel) { 34 scoped_refptr<gpu::GpuChannelHost> gpu_channel) {
35 if (!compositor) 35 if (!compositor)
36 return; 36 return;
37 WindowTreeHost* host = 37 WindowTreeHost* host =
38 WindowTreeHost::GetForAcceleratedWidget(compositor->widget()); 38 WindowTreeHost::GetForAcceleratedWidget(compositor->widget());
39 WindowPortMus* window_port = WindowPortMus::Get(host->window()); 39 WindowPortMus* window_port = WindowPortMus::Get(host->window());
40 DCHECK(window_port); 40 DCHECK(window_port);
41 std::unique_ptr<cc::CompositorFrameSink> compositor_frame_sink = 41 std::unique_ptr<cc::CompositorFrameSink> compositor_frame_sink =
42 window_port->RequestCompositorFrameSink( 42 window_port->CreateCompositorFrameSinkWithContextAndBufferManager(
Fady Samuel 2017/05/30 18:36:41 This is a really long name? Can we just keep the n
Peng 2017/05/31 20:12:25 Done.
43 gpu_->CreateContextProvider(std::move(gpu_channel)), 43 gpu_->CreateContextProvider(std::move(gpu_channel)),
44 gpu_->gpu_memory_buffer_manager()); 44 gpu_->gpu_memory_buffer_manager());
45 compositor->SetCompositorFrameSink(std::move(compositor_frame_sink)); 45 compositor->SetCompositorFrameSink(std::move(compositor_frame_sink));
46 } 46 }
47 47
48 void MusContextFactory::CreateCompositorFrameSink( 48 void MusContextFactory::CreateCompositorFrameSink(
49 base::WeakPtr<ui::Compositor> compositor) { 49 base::WeakPtr<ui::Compositor> compositor) {
50 gpu_->EstablishGpuChannel( 50 gpu_->EstablishGpuChannel(
51 base::Bind(&MusContextFactory::OnEstablishedGpuChannel, 51 base::Bind(&MusContextFactory::OnEstablishedGpuChannel,
52 weak_ptr_factory_.GetWeakPtr(), compositor)); 52 weak_ptr_factory_.GetWeakPtr(), compositor));
(...skipping 26 matching lines...) Expand all
79 79
80 cc::TaskGraphRunner* MusContextFactory::GetTaskGraphRunner() { 80 cc::TaskGraphRunner* MusContextFactory::GetTaskGraphRunner() {
81 return raster_thread_helper_.task_graph_runner(); 81 return raster_thread_helper_.task_graph_runner();
82 } 82 }
83 83
84 const cc::RendererSettings& MusContextFactory::GetRendererSettings() const { 84 const cc::RendererSettings& MusContextFactory::GetRendererSettings() const {
85 return renderer_settings_; 85 return renderer_settings_;
86 } 86 }
87 87
88 } // namespace aura 88 } // namespace aura
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698