| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/command_buffer/service/gpu_control_service.h" | 5 #include "gpu/command_buffer/service/gpu_control_service.h" |
| 6 | 6 |
| 7 #include "gpu/command_buffer/client/gpu_memory_buffer_factory.h" | 7 #include "gpu/command_buffer/client/gpu_memory_buffer_factory.h" |
| 8 #include "gpu/command_buffer/service/gpu_memory_buffer_manager.h" | 8 #include "gpu/command_buffer/service/gpu_memory_buffer_manager.h" |
| 9 #include "gpu/command_buffer/service/mailbox_manager.h" | 9 #include "gpu/command_buffer/service/mailbox_manager.h" |
| 10 #include "gpu/command_buffer/service/query_manager.h" | 10 #include "gpu/command_buffer/service/query_manager.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 } | 30 } |
| 31 | 31 |
| 32 gpu::Capabilities GpuControlService::GetCapabilities() { | 32 gpu::Capabilities GpuControlService::GetCapabilities() { |
| 33 return capabilities_; | 33 return capabilities_; |
| 34 } | 34 } |
| 35 | 35 |
| 36 gfx::GpuMemoryBuffer* GpuControlService::CreateGpuMemoryBuffer( | 36 gfx::GpuMemoryBuffer* GpuControlService::CreateGpuMemoryBuffer( |
| 37 size_t width, | 37 size_t width, |
| 38 size_t height, | 38 size_t height, |
| 39 unsigned internalformat, | 39 unsigned internalformat, |
| 40 unsigned usage, |
| 40 int32* id) { | 41 int32* id) { |
| 41 *id = -1; | 42 *id = -1; |
| 42 | 43 |
| 43 CHECK(gpu_memory_buffer_factory_) << "No GPU memory buffer factory provided"; | 44 CHECK(gpu_memory_buffer_factory_) << "No GPU memory buffer factory provided"; |
| 44 linked_ptr<gfx::GpuMemoryBuffer> buffer = make_linked_ptr( | 45 linked_ptr<gfx::GpuMemoryBuffer> buffer = |
| 45 gpu_memory_buffer_factory_->CreateGpuMemoryBuffer(width, | 46 make_linked_ptr(gpu_memory_buffer_factory_->CreateGpuMemoryBuffer( |
| 46 height, | 47 width, height, internalformat, usage)); |
| 47 internalformat)); | |
| 48 if (!buffer.get()) | 48 if (!buffer.get()) |
| 49 return NULL; | 49 return NULL; |
| 50 | 50 |
| 51 static int32 next_id = 1; | 51 static int32 next_id = 1; |
| 52 *id = next_id++; | 52 *id = next_id++; |
| 53 | 53 |
| 54 if (!RegisterGpuMemoryBuffer(*id, | 54 if (!RegisterGpuMemoryBuffer(*id, |
| 55 buffer->GetHandle(), | 55 buffer->GetHandle(), |
| 56 width, | 56 width, |
| 57 height, | 57 height, |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 size_t height, | 117 size_t height, |
| 118 unsigned internalformat) { | 118 unsigned internalformat) { |
| 119 return gpu_memory_buffer_manager_->RegisterGpuMemoryBuffer(id, | 119 return gpu_memory_buffer_manager_->RegisterGpuMemoryBuffer(id, |
| 120 buffer, | 120 buffer, |
| 121 width, | 121 width, |
| 122 height, | 122 height, |
| 123 internalformat); | 123 internalformat); |
| 124 } | 124 } |
| 125 | 125 |
| 126 } // namespace gpu | 126 } // namespace gpu |
| OLD | NEW |