Chromium Code Reviews| Index: services/ui/public/cpp/gpu/gpu.cc |
| diff --git a/services/ui/public/cpp/gpu/gpu.cc b/services/ui/public/cpp/gpu/gpu.cc |
| index 4cd0d5731a94ef7df3a2e8b556e56edef78aef74..ab21a16c1184ef796ff9be5ec9139f98e5f89924 100644 |
| --- a/services/ui/public/cpp/gpu/gpu.cc |
| +++ b/services/ui/public/cpp/gpu/gpu.cc |
| @@ -10,6 +10,7 @@ |
| #include "mojo/public/cpp/system/platform_handle.h" |
| #include "services/service_manager/public/cpp/connector.h" |
| #include "services/ui/public/cpp/gpu/client_gpu_memory_buffer_manager.h" |
| +#include "services/ui/public/cpp/gpu/context_provider_command_buffer.h" |
| #include "services/ui/public/interfaces/constants.mojom.h" |
| #include "services/ui/public/interfaces/gpu.mojom.h" |
| @@ -64,6 +65,27 @@ std::unique_ptr<Gpu> Gpu::Create( |
| return base::WrapUnique(new Gpu(nullptr, provider, std::move(task_runner))); |
| } |
| +scoped_refptr<cc::ContextProvider> Gpu::CreateContextProvider( |
| + scoped_refptr<gpu::GpuChannelHost> gpu_channel) { |
| + constexpr bool automatic_flushes = false; |
| + constexpr bool support_locking = false; |
| + constexpr ui::ContextProviderCommandBuffer* shared_context_provider = nullptr; |
|
msw
2016/12/19 21:33:33
optional nit: reorder after attributes to match pa
sadrul
2016/12/20 03:53:20
Done.
|
| + gpu::gles2::ContextCreationAttribHelper attributes; |
| + attributes.alpha_size = -1; |
|
msw
2016/12/19 21:33:33
nit: this is the default; explicit assignment is n
sadrul
2016/12/20 03:53:20
Good point. I have kept this for now though, since
|
| + attributes.depth_size = 0; |
| + attributes.stencil_size = 0; |
| + attributes.samples = 0; |
| + attributes.sample_buffers = 0; |
| + attributes.bind_generates_resource = false; |
| + attributes.lose_context_when_out_of_memory = true; |
| + return make_scoped_refptr(new ui::ContextProviderCommandBuffer( |
| + std::move(gpu_channel), gpu::GPU_STREAM_DEFAULT, |
| + gpu::GpuStreamPriority::NORMAL, gpu::kNullSurfaceHandle, |
| + GURL("chrome://gpu/MusContextFactory"), automatic_flushes, |
| + support_locking, gpu::SharedMemoryLimits(), attributes, |
| + shared_context_provider, ui::command_buffer_metrics::MUS_CLIENT_CONTEXT)); |
| +} |
| + |
| void Gpu::EstablishGpuChannel( |
| const gpu::GpuChannelEstablishedCallback& callback) { |
| DCHECK(IsMainThread()); |