OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/mus/public/cpp/gles2_context.h" | 5 #include "components/mus/public/cpp/gles2_context.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <utility> | 10 #include <utility> |
(...skipping 28 matching lines...) Expand all Loading... |
39 mojom::CommandBufferPtr command_buffer_ptr; | 39 mojom::CommandBufferPtr command_buffer_ptr; |
40 gpu->CreateOffscreenGLES2Context(GetProxy(&command_buffer_ptr)); | 40 gpu->CreateOffscreenGLES2Context(GetProxy(&command_buffer_ptr)); |
41 command_buffer_client_impl_.reset( | 41 command_buffer_client_impl_.reset( |
42 new CommandBufferClientImpl(attribs, std::move(command_buffer_ptr))); | 42 new CommandBufferClientImpl(attribs, std::move(command_buffer_ptr))); |
43 if (!command_buffer_client_impl_->Initialize()) | 43 if (!command_buffer_client_impl_->Initialize()) |
44 return false; | 44 return false; |
45 command_buffer = command_buffer_client_impl_.get(); | 45 command_buffer = command_buffer_client_impl_.get(); |
46 gpu_control = command_buffer_client_impl_.get(); | 46 gpu_control = command_buffer_client_impl_.get(); |
47 } else { | 47 } else { |
48 scoped_refptr<gpu::GpuChannelHost> gpu_channel_host = | 48 scoped_refptr<gpu::GpuChannelHost> gpu_channel_host = |
49 GpuService::GetInstance()->EstablishGpuChannel(connector); | 49 GpuService::GetInstance()->EstablishGpuChannelSync(); |
50 if (!gpu_channel_host) | 50 if (!gpu_channel_host) |
51 return false; | 51 return false; |
52 gpu::SurfaceHandle surface_handle = gfx::kNullAcceleratedWidget; | 52 gpu::SurfaceHandle surface_handle = gfx::kNullAcceleratedWidget; |
53 // TODO(penghuang): support shared group. | 53 // TODO(penghuang): support shared group. |
54 gpu::CommandBufferProxyImpl* shared_command_buffer = nullptr; | 54 gpu::CommandBufferProxyImpl* shared_command_buffer = nullptr; |
55 gpu::GpuStreamId stream_id = gpu::GpuStreamId::GPU_STREAM_DEFAULT; | 55 gpu::GpuStreamId stream_id = gpu::GpuStreamId::GPU_STREAM_DEFAULT; |
56 gpu::GpuStreamPriority stream_priority = gpu::GpuStreamPriority::NORMAL; | 56 gpu::GpuStreamPriority stream_priority = gpu::GpuStreamPriority::NORMAL; |
57 gl::GpuPreference gpu_preference = gl::PreferIntegratedGpu; | 57 gl::GpuPreference gpu_preference = gl::PreferIntegratedGpu; |
58 gpu::gles2::ContextCreationAttribHelper attributes; | 58 gpu::gles2::ContextCreationAttribHelper attributes; |
59 // TODO(penghuang): figure a useful active_url. | 59 // TODO(penghuang): figure a useful active_url. |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 std::unique_ptr<GLES2Context> GLES2Context::CreateOffscreenContext( | 101 std::unique_ptr<GLES2Context> GLES2Context::CreateOffscreenContext( |
102 const std::vector<int32_t>& attribs, | 102 const std::vector<int32_t>& attribs, |
103 shell::Connector* connector) { | 103 shell::Connector* connector) { |
104 std::unique_ptr<GLES2Context> gles2_context(new GLES2Context); | 104 std::unique_ptr<GLES2Context> gles2_context(new GLES2Context); |
105 if (!gles2_context->Initialize(attribs, connector)) | 105 if (!gles2_context->Initialize(attribs, connector)) |
106 gles2_context.reset(); | 106 gles2_context.reset(); |
107 return gles2_context; | 107 return gles2_context; |
108 } | 108 } |
109 | 109 |
110 } // namespace mus | 110 } // namespace mus |
OLD | NEW |