OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "gpu/ipc/gl_in_process_context.h" | 5 #include "gpu/ipc/gl_in_process_context.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 // GLInProcessContext implementation: | 65 // GLInProcessContext implementation: |
66 gpu::Capabilities GetCapabilities() override; | 66 gpu::Capabilities GetCapabilities() override; |
67 gles2::GLES2Implementation* GetImplementation() override; | 67 gles2::GLES2Implementation* GetImplementation() override; |
68 void SetSwapBuffersCompletionCallback( | 68 void SetSwapBuffersCompletionCallback( |
69 const gpu::InProcessCommandBuffer::SwapBuffersCompletionCallback& | 69 const gpu::InProcessCommandBuffer::SwapBuffersCompletionCallback& |
70 callback) override; | 70 callback) override; |
71 void SetUpdateVSyncParametersCallback( | 71 void SetUpdateVSyncParametersCallback( |
72 const gpu::InProcessCommandBuffer::UpdateVSyncParametersCallback& | 72 const gpu::InProcessCommandBuffer::UpdateVSyncParametersCallback& |
73 callback) override; | 73 callback) override; |
74 void SetLock(base::Lock* lock) override; | 74 void SetLock(base::Lock* lock) override; |
| 75 InProcessCommandBuffer* GetInProcessCommandBuffer() override; |
75 | 76 |
76 private: | 77 private: |
77 void Destroy(); | 78 void Destroy(); |
78 void OnSignalSyncPoint(const base::Closure& callback); | 79 void OnSignalSyncPoint(const base::Closure& callback); |
79 | 80 |
80 std::unique_ptr<gles2::GLES2CmdHelper> gles2_helper_; | 81 std::unique_ptr<gles2::GLES2CmdHelper> gles2_helper_; |
81 std::unique_ptr<TransferBuffer> transfer_buffer_; | 82 std::unique_ptr<TransferBuffer> transfer_buffer_; |
82 std::unique_ptr<gles2::GLES2Implementation> gles2_implementation_; | 83 std::unique_ptr<gles2::GLES2Implementation> gles2_implementation_; |
83 std::unique_ptr<InProcessCommandBuffer> command_buffer_; | 84 std::unique_ptr<InProcessCommandBuffer> command_buffer_; |
84 | 85 |
(...skipping 23 matching lines...) Expand all Loading... |
108 void GLInProcessContextImpl::SetUpdateVSyncParametersCallback( | 109 void GLInProcessContextImpl::SetUpdateVSyncParametersCallback( |
109 const gpu::InProcessCommandBuffer::UpdateVSyncParametersCallback& | 110 const gpu::InProcessCommandBuffer::UpdateVSyncParametersCallback& |
110 callback) { | 111 callback) { |
111 command_buffer_->SetUpdateVSyncParametersCallback(callback); | 112 command_buffer_->SetUpdateVSyncParametersCallback(callback); |
112 } | 113 } |
113 | 114 |
114 void GLInProcessContextImpl::SetLock(base::Lock* lock) { | 115 void GLInProcessContextImpl::SetLock(base::Lock* lock) { |
115 NOTREACHED(); | 116 NOTREACHED(); |
116 } | 117 } |
117 | 118 |
| 119 InProcessCommandBuffer* GLInProcessContextImpl::GetInProcessCommandBuffer() { |
| 120 return command_buffer_.get(); |
| 121 } |
| 122 |
118 bool GLInProcessContextImpl::Initialize( | 123 bool GLInProcessContextImpl::Initialize( |
119 scoped_refptr<gl::GLSurface> surface, | 124 scoped_refptr<gl::GLSurface> surface, |
120 bool is_offscreen, | 125 bool is_offscreen, |
121 GLInProcessContext* share_context, | 126 GLInProcessContext* share_context, |
122 SurfaceHandle window, | 127 SurfaceHandle window, |
123 const gles2::ContextCreationAttribHelper& attribs, | 128 const gles2::ContextCreationAttribHelper& attribs, |
124 const scoped_refptr<InProcessCommandBuffer::Service>& service, | 129 const scoped_refptr<InProcessCommandBuffer::Service>& service, |
125 const SharedMemoryLimits& mem_limits, | 130 const SharedMemoryLimits& mem_limits, |
126 GpuMemoryBufferManager* gpu_memory_buffer_manager, | 131 GpuMemoryBufferManager* gpu_memory_buffer_manager, |
127 ImageFactory* image_factory, | 132 ImageFactory* image_factory, |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 if (!context->Initialize(surface, is_offscreen, share_context, window, | 231 if (!context->Initialize(surface, is_offscreen, share_context, window, |
227 attribs, service, memory_limits, | 232 attribs, service, memory_limits, |
228 gpu_memory_buffer_manager, image_factory, | 233 gpu_memory_buffer_manager, image_factory, |
229 std::move(task_runner))) | 234 std::move(task_runner))) |
230 return NULL; | 235 return NULL; |
231 | 236 |
232 return context.release(); | 237 return context.release(); |
233 } | 238 } |
234 | 239 |
235 } // namespace gpu | 240 } // namespace gpu |
OLD | NEW |