Chromium Code Reviews| OLD | NEW |
|---|---|
| 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" |
| 11 #include "ui/aura/mus/window_port_mus.h" | 11 #include "ui/aura/mus/window_port_mus.h" |
| 12 #include "ui/aura/window_tree_host.h" | 12 #include "ui/aura/window_tree_host.h" |
| 13 #include "ui/compositor/compositor_switches.h" | 13 #include "ui/compositor/compositor_switches.h" |
| 14 #include "ui/compositor/compositor_util.h" | 14 #include "ui/compositor/compositor_util.h" |
| 15 #include "ui/display/display_switches.h" | 15 #include "ui/display/display_switches.h" |
| 16 #include "ui/gfx/switches.h" | 16 #include "ui/gfx/switches.h" |
| 17 #include "ui/gl/gl_bindings.h" | 17 #include "ui/gl/gl_bindings.h" |
| 18 | 18 |
| 19 namespace aura { | 19 namespace aura { |
| 20 | 20 |
| 21 MusContextFactory::MusContextFactory(ui::Gpu* gpu) | 21 MusContextFactory::MusContextFactory(ui::Gpu* gpu) |
| 22 : gpu_(gpu), | 22 : gpu_(gpu), |
| 23 renderer_settings_(ui::CreateRendererSettings( | 23 renderer_settings_(ui::CreateRendererSettings( |
| 24 [](gfx::BufferFormat format, gfx::BufferUsage usage) -> uint32_t { | 24 content::GetBufferToTextureTargetMap()), |
|
boliu
2017/06/12 16:31:39
ui can't depend on content. does this even compile
sujith
2017/06/14 10:30:18
i was building for android, so it doesn't throw an
| |
| 25 // TODO(sad): http://crbug.com/675431 | |
| 26 return GL_TEXTURE_2D; | |
| 27 })), | |
| 28 weak_ptr_factory_(this) {} | 25 weak_ptr_factory_(this) {} |
| 29 | 26 |
| 30 MusContextFactory::~MusContextFactory() {} | 27 MusContextFactory::~MusContextFactory() {} |
| 31 | 28 |
| 32 void MusContextFactory::OnEstablishedGpuChannel( | 29 void MusContextFactory::OnEstablishedGpuChannel( |
| 33 base::WeakPtr<ui::Compositor> compositor, | 30 base::WeakPtr<ui::Compositor> compositor, |
| 34 scoped_refptr<gpu::GpuChannelHost> gpu_channel) { | 31 scoped_refptr<gpu::GpuChannelHost> gpu_channel) { |
| 35 if (!compositor) | 32 if (!compositor) |
| 36 return; | 33 return; |
| 37 WindowTreeHost* host = | 34 WindowTreeHost* host = |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 79 | 76 |
| 80 cc::TaskGraphRunner* MusContextFactory::GetTaskGraphRunner() { | 77 cc::TaskGraphRunner* MusContextFactory::GetTaskGraphRunner() { |
| 81 return raster_thread_helper_.task_graph_runner(); | 78 return raster_thread_helper_.task_graph_runner(); |
| 82 } | 79 } |
| 83 | 80 |
| 84 const cc::ResourceSettings& MusContextFactory::GetResourceSettings() const { | 81 const cc::ResourceSettings& MusContextFactory::GetResourceSettings() const { |
| 85 return renderer_settings_.resource_settings; | 82 return renderer_settings_.resource_settings; |
| 86 } | 83 } |
| 87 | 84 |
| 88 } // namespace aura | 85 } // namespace aura |
| OLD | NEW |