| 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 gfx::AcceleratedWidget window, | 57 gfx::AcceleratedWidget window, |
| 58 const gpu::gles2::ContextCreationAttribHelper& attribs, | 58 const gpu::gles2::ContextCreationAttribHelper& attribs, |
| 59 const scoped_refptr<InProcessCommandBuffer::Service>& service, | 59 const scoped_refptr<InProcessCommandBuffer::Service>& service, |
| 60 const SharedMemoryLimits& mem_limits, | 60 const SharedMemoryLimits& mem_limits, |
| 61 GpuMemoryBufferManager* gpu_memory_buffer_manager, | 61 GpuMemoryBufferManager* gpu_memory_buffer_manager, |
| 62 ImageFactory* image_factory, | 62 ImageFactory* image_factory, |
| 63 scoped_refptr<base::SingleThreadTaskRunner> task_runner); | 63 scoped_refptr<base::SingleThreadTaskRunner> task_runner); |
| 64 | 64 |
| 65 // GLInProcessContext implementation: | 65 // GLInProcessContext implementation: |
| 66 gles2::GLES2Implementation* GetImplementation() override; | 66 gles2::GLES2Implementation* GetImplementation() override; |
| 67 InProcessCommandBuffer* GetInProcessCommandBuffer() override; |
| 67 void SetLock(base::Lock* lock) override; | 68 void SetLock(base::Lock* lock) override; |
| 68 | 69 |
| 69 private: | 70 private: |
| 70 void Destroy(); | 71 void Destroy(); |
| 71 void OnSignalSyncPoint(const base::Closure& callback); | 72 void OnSignalSyncPoint(const base::Closure& callback); |
| 72 | 73 |
| 73 std::unique_ptr<gles2::GLES2CmdHelper> gles2_helper_; | 74 std::unique_ptr<gles2::GLES2CmdHelper> gles2_helper_; |
| 74 std::unique_ptr<TransferBuffer> transfer_buffer_; | 75 std::unique_ptr<TransferBuffer> transfer_buffer_; |
| 75 std::unique_ptr<gles2::GLES2Implementation> gles2_implementation_; | 76 std::unique_ptr<gles2::GLES2Implementation> gles2_implementation_; |
| 76 std::unique_ptr<InProcessCommandBuffer> command_buffer_; | 77 std::unique_ptr<InProcessCommandBuffer> command_buffer_; |
| 77 | 78 |
| 78 DISALLOW_COPY_AND_ASSIGN(GLInProcessContextImpl); | 79 DISALLOW_COPY_AND_ASSIGN(GLInProcessContextImpl); |
| 79 }; | 80 }; |
| 80 | 81 |
| 81 GLInProcessContextImpl::GLInProcessContextImpl() = default; | 82 GLInProcessContextImpl::GLInProcessContextImpl() = default; |
| 82 | 83 |
| 83 GLInProcessContextImpl::~GLInProcessContextImpl() { | 84 GLInProcessContextImpl::~GLInProcessContextImpl() { |
| 84 Destroy(); | 85 Destroy(); |
| 85 } | 86 } |
| 86 | 87 |
| 87 gles2::GLES2Implementation* GLInProcessContextImpl::GetImplementation() { | 88 gles2::GLES2Implementation* GLInProcessContextImpl::GetImplementation() { |
| 88 return gles2_implementation_.get(); | 89 return gles2_implementation_.get(); |
| 89 } | 90 } |
| 90 | 91 |
| 92 InProcessCommandBuffer* GLInProcessContextImpl::GetInProcessCommandBuffer() { |
| 93 return command_buffer_.get(); |
| 94 } |
| 95 |
| 91 void GLInProcessContextImpl::SetLock(base::Lock* lock) { | 96 void GLInProcessContextImpl::SetLock(base::Lock* lock) { |
| 92 NOTREACHED(); | 97 NOTREACHED(); |
| 93 } | 98 } |
| 94 | 99 |
| 95 bool GLInProcessContextImpl::Initialize( | 100 bool GLInProcessContextImpl::Initialize( |
| 96 scoped_refptr<gl::GLSurface> surface, | 101 scoped_refptr<gl::GLSurface> surface, |
| 97 bool is_offscreen, | 102 bool is_offscreen, |
| 98 GLInProcessContext* share_context, | 103 GLInProcessContext* share_context, |
| 99 gfx::AcceleratedWidget window, | 104 gfx::AcceleratedWidget window, |
| 100 const gles2::ContextCreationAttribHelper& attribs, | 105 const gles2::ContextCreationAttribHelper& attribs, |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 if (!context->Initialize(surface, is_offscreen, share_context, window, | 208 if (!context->Initialize(surface, is_offscreen, share_context, window, |
| 204 attribs, service, memory_limits, | 209 attribs, service, memory_limits, |
| 205 gpu_memory_buffer_manager, image_factory, | 210 gpu_memory_buffer_manager, image_factory, |
| 206 std::move(task_runner))) | 211 std::move(task_runner))) |
| 207 return NULL; | 212 return NULL; |
| 208 | 213 |
| 209 return context.release(); | 214 return context.release(); |
| 210 } | 215 } |
| 211 | 216 |
| 212 } // namespace gpu | 217 } // namespace gpu |
| OLD | NEW |