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

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

Issue 2559343003: mus: Rename GpuService to Gpu. (Closed)
Patch Set: . 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 | « ui/aura/mus/mus_context_factory.h ('k') | ui/views/mus/mus_client.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "services/ui/public/cpp/context_provider.h" 8 #include "services/ui/public/cpp/context_provider.h"
9 #include "services/ui/public/cpp/gpu/gpu_service.h" 9 #include "services/ui/public/cpp/gpu/gpu.h"
10 #include "ui/aura/mus/window_port_mus.h" 10 #include "ui/aura/mus/window_port_mus.h"
11 #include "ui/aura/window_tree_host.h" 11 #include "ui/aura/window_tree_host.h"
12 #include "ui/compositor/reflector.h" 12 #include "ui/compositor/reflector.h"
13 #include "ui/gl/gl_bindings.h" 13 #include "ui/gl/gl_bindings.h"
14 14
15 namespace aura { 15 namespace aura {
16 namespace { 16 namespace {
17 17
18 class FakeReflector : public ui::Reflector { 18 class FakeReflector : public ui::Reflector {
19 public: 19 public:
20 FakeReflector() {} 20 FakeReflector() {}
21 ~FakeReflector() override {} 21 ~FakeReflector() override {}
22 void OnMirroringCompositorResized() override {} 22 void OnMirroringCompositorResized() override {}
23 void AddMirroringLayer(ui::Layer* layer) override {} 23 void AddMirroringLayer(ui::Layer* layer) override {}
24 void RemoveMirroringLayer(ui::Layer* layer) override {} 24 void RemoveMirroringLayer(ui::Layer* layer) override {}
25 }; 25 };
26 26
27 } // namespace 27 } // namespace
28 28
29 MusContextFactory::MusContextFactory(ui::GpuService* gpu_service) 29 MusContextFactory::MusContextFactory(ui::Gpu* gpu)
30 : next_sink_id_(1u), gpu_service_(gpu_service) {} 30 : next_sink_id_(1u), gpu_(gpu) {}
31 31
32 MusContextFactory::~MusContextFactory() {} 32 MusContextFactory::~MusContextFactory() {}
33 33
34 void MusContextFactory::CreateCompositorFrameSink( 34 void MusContextFactory::CreateCompositorFrameSink(
35 base::WeakPtr<ui::Compositor> compositor) { 35 base::WeakPtr<ui::Compositor> compositor) {
36 WindowTreeHost* host = 36 WindowTreeHost* host =
37 WindowTreeHost::GetForAcceleratedWidget(compositor->widget()); 37 WindowTreeHost::GetForAcceleratedWidget(compositor->widget());
38 WindowPortMus* window_port = WindowPortMus::Get(host->window()); 38 WindowPortMus* window_port = WindowPortMus::Get(host->window());
39 DCHECK(window_port); 39 DCHECK(window_port);
40 auto compositor_frame_sink = window_port->RequestCompositorFrameSink( 40 auto compositor_frame_sink = window_port->RequestCompositorFrameSink(
41 ui::mojom::CompositorFrameSinkType::DEFAULT, 41 ui::mojom::CompositorFrameSinkType::DEFAULT,
42 make_scoped_refptr( 42 make_scoped_refptr(
43 new ui::ContextProvider(gpu_service_->EstablishGpuChannelSync())), 43 new ui::ContextProvider(gpu_->EstablishGpuChannelSync())),
44 gpu_service_->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 std::unique_ptr<ui::Reflector> MusContextFactory::CreateReflector( 48 std::unique_ptr<ui::Reflector> MusContextFactory::CreateReflector(
49 ui::Compositor* mirroed_compositor, 49 ui::Compositor* mirroed_compositor,
50 ui::Layer* mirroring_layer) { 50 ui::Layer* mirroring_layer) {
51 // NOTIMPLEMENTED(); 51 // NOTIMPLEMENTED();
52 return base::WrapUnique(new FakeReflector); 52 return base::WrapUnique(new FakeReflector);
53 } 53 }
54 54
(...skipping 15 matching lines...) Expand all
70 return false; 70 return false;
71 } 71 }
72 72
73 uint32_t MusContextFactory::GetImageTextureTarget(gfx::BufferFormat format, 73 uint32_t MusContextFactory::GetImageTextureTarget(gfx::BufferFormat format,
74 gfx::BufferUsage usage) { 74 gfx::BufferUsage usage) {
75 // No GpuMemoryBuffer support, so just return GL_TEXTURE_2D. 75 // No GpuMemoryBuffer support, so just return GL_TEXTURE_2D.
76 return GL_TEXTURE_2D; 76 return GL_TEXTURE_2D;
77 } 77 }
78 78
79 gpu::GpuMemoryBufferManager* MusContextFactory::GetGpuMemoryBufferManager() { 79 gpu::GpuMemoryBufferManager* MusContextFactory::GetGpuMemoryBufferManager() {
80 return gpu_service_->gpu_memory_buffer_manager(); 80 return gpu_->gpu_memory_buffer_manager();
81 } 81 }
82 82
83 cc::TaskGraphRunner* MusContextFactory::GetTaskGraphRunner() { 83 cc::TaskGraphRunner* MusContextFactory::GetTaskGraphRunner() {
84 return raster_thread_helper_.task_graph_runner(); 84 return raster_thread_helper_.task_graph_runner();
85 } 85 }
86 86
87 cc::FrameSinkId MusContextFactory::AllocateFrameSinkId() { 87 cc::FrameSinkId MusContextFactory::AllocateFrameSinkId() {
88 return cc::FrameSinkId(0, next_sink_id_++); 88 return cc::FrameSinkId(0, next_sink_id_++);
89 } 89 }
90 90
91 cc::SurfaceManager* MusContextFactory::GetSurfaceManager() { 91 cc::SurfaceManager* MusContextFactory::GetSurfaceManager() {
92 return &surface_manager_; 92 return &surface_manager_;
93 } 93 }
94 94
95 void MusContextFactory::SetDisplayVisible(ui::Compositor* compositor, 95 void MusContextFactory::SetDisplayVisible(ui::Compositor* compositor,
96 bool visible) { 96 bool visible) {
97 // TODO(fsamuel): display[compositor]->SetVisible(visible); 97 // TODO(fsamuel): display[compositor]->SetVisible(visible);
98 } 98 }
99 99
100 void MusContextFactory::ResizeDisplay(ui::Compositor* compositor, 100 void MusContextFactory::ResizeDisplay(ui::Compositor* compositor,
101 const gfx::Size& size) { 101 const gfx::Size& size) {
102 // TODO(fsamuel): display[compositor]->Resize(size); 102 // TODO(fsamuel): display[compositor]->Resize(size);
103 } 103 }
104 104
105 } // namespace aura 105 } // namespace aura
OLDNEW
« no previous file with comments | « ui/aura/mus/mus_context_factory.h ('k') | ui/views/mus/mus_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698