Chromium Code Reviews| Index: services/ui/public/cpp/gles2_context.cc |
| diff --git a/services/ui/public/cpp/gles2_context.cc b/services/ui/public/cpp/gles2_context.cc |
| index 4d4dec8ac62b46cab0597d24ca44aaac56ac3822..718951a0b55452b6ee20bd4146508f97fbff469d 100644 |
| --- a/services/ui/public/cpp/gles2_context.cc |
| +++ b/services/ui/public/cpp/gles2_context.cc |
| @@ -25,11 +25,9 @@ GLES2Context::GLES2Context() {} |
| GLES2Context::~GLES2Context() {} |
| -bool GLES2Context::Initialize(GpuService* gpu_service) { |
| - scoped_refptr<gpu::GpuChannelHost> gpu_channel_host = |
| - gpu_service->EstablishGpuChannelSync(); |
| - if (!gpu_channel_host) |
| - return false; |
| +bool GLES2Context::Initialize( |
| + scoped_refptr<gpu::GpuChannelHost> gpu_channel_host) { |
| + DCHECK(gpu_channel_host); |
| gpu::SurfaceHandle surface_handle = gfx::kNullAcceleratedWidget; |
| // TODO(penghuang): support shared group. |
| gpu::CommandBufferProxyImpl* shared_command_buffer = nullptr; |
| @@ -76,9 +74,11 @@ bool GLES2Context::Initialize(GpuService* gpu_service) { |
| // static |
| std::unique_ptr<GLES2Context> GLES2Context::CreateOffscreenContext( |
| - GpuService* gpu_service) { |
| + scoped_refptr<gpu::GpuChannelHost> gpu_channel_host) { |
| + if (!gpu_channel_host) |
| + return nullptr; |
| std::unique_ptr<GLES2Context> gles2_context(new GLES2Context); |
|
sky
2016/08/18 13:15:45
This section is subtle and worth a comment. For ex
sadrul
2016/08/18 14:59:48
We keep the context if it was successfully initial
sky
2016/08/18 19:12:09
Makes sense, please add a comment to the code as w
sadrul
2016/08/18 20:53:28
Done.
|
| - if (!gles2_context->Initialize(gpu_service)) |
| + if (!gles2_context->Initialize(std::move(gpu_channel_host))) |
| gles2_context.reset(); |
| return gles2_context; |
| } |