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

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

Issue 2879463002: Initialize RendererSettings in ContextFactory (Closed)
Patch Set: Address comments Created 3 years, 7 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/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "cc/base/switches.h"
8 #include "services/ui/public/cpp/gpu/gpu.h" 10 #include "services/ui/public/cpp/gpu/gpu.h"
9 #include "ui/aura/mus/window_port_mus.h" 11 #include "ui/aura/mus/window_port_mus.h"
10 #include "ui/aura/window_tree_host.h" 12 #include "ui/aura/window_tree_host.h"
13 #include "ui/compositor/compositor_switches.h"
14 #include "ui/compositor/compositor_util.h"
15 #include "ui/display/display_switches.h"
16 #include "ui/gfx/switches.h"
11 #include "ui/gl/gl_bindings.h" 17 #include "ui/gl/gl_bindings.h"
12 18
13 namespace aura { 19 namespace aura {
14 20
15 MusContextFactory::MusContextFactory(ui::Gpu* gpu) 21 MusContextFactory::MusContextFactory(ui::Gpu* gpu)
16 : gpu_(gpu), weak_ptr_factory_(this) {} 22 : gpu_(gpu), weak_ptr_factory_(this) {
23 renderer_settings_ = ui::CreateRendererSettings(
danakj 2017/05/12 14:21:37 same with this?
Alex Z. 2017/05/12 14:37:49 Done.
24 [](gfx::BufferFormat format, gfx::BufferUsage usage) -> uint32_t {
25 // TODO(sad): http://crbug.com/675431
26 return GL_TEXTURE_2D;
27 });
28 }
17 29
18 MusContextFactory::~MusContextFactory() {} 30 MusContextFactory::~MusContextFactory() {}
19 31
20 void MusContextFactory::OnEstablishedGpuChannel( 32 void MusContextFactory::OnEstablishedGpuChannel(
21 base::WeakPtr<ui::Compositor> compositor, 33 base::WeakPtr<ui::Compositor> compositor,
22 scoped_refptr<gpu::GpuChannelHost> gpu_channel) { 34 scoped_refptr<gpu::GpuChannelHost> gpu_channel) {
23 if (!compositor) 35 if (!compositor)
24 return; 36 return;
25 WindowTreeHost* host = 37 WindowTreeHost* host =
26 WindowTreeHost::GetForAcceleratedWidget(compositor->widget()); 38 WindowTreeHost::GetForAcceleratedWidget(compositor->widget());
(...skipping 28 matching lines...) Expand all
55 } 67 }
56 68
57 void MusContextFactory::RemoveCompositor(ui::Compositor* compositor) { 69 void MusContextFactory::RemoveCompositor(ui::Compositor* compositor) {
58 // NOTIMPLEMENTED(); 70 // NOTIMPLEMENTED();
59 } 71 }
60 72
61 double MusContextFactory::GetRefreshRate() const { 73 double MusContextFactory::GetRefreshRate() const {
62 return 60.0; 74 return 60.0;
63 } 75 }
64 76
65 uint32_t MusContextFactory::GetImageTextureTarget(gfx::BufferFormat format,
66 gfx::BufferUsage usage) {
67 // TODO(sad): http://crbug.com/675431
68 return GL_TEXTURE_2D;
69 }
70
71 gpu::GpuMemoryBufferManager* MusContextFactory::GetGpuMemoryBufferManager() { 77 gpu::GpuMemoryBufferManager* MusContextFactory::GetGpuMemoryBufferManager() {
72 return gpu_->gpu_memory_buffer_manager(); 78 return gpu_->gpu_memory_buffer_manager();
73 } 79 }
74 80
75 cc::TaskGraphRunner* MusContextFactory::GetTaskGraphRunner() { 81 cc::TaskGraphRunner* MusContextFactory::GetTaskGraphRunner() {
76 return raster_thread_helper_.task_graph_runner(); 82 return raster_thread_helper_.task_graph_runner();
77 } 83 }
78 84
85 const cc::RendererSettings& MusContextFactory::GetRendererSettings() const {
86 return renderer_settings_;
87 }
88
79 } // namespace aura 89 } // namespace aura
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698