| 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/in_process_command_buffer.h" | 5 #include "gpu/command_buffer/service/in_process_command_buffer.h" |
| 6 | 6 |
| 7 #include <queue> | 7 #include <queue> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 600 } | 600 } |
| 601 | 601 |
| 602 gpu::Capabilities InProcessCommandBuffer::GetCapabilities() { | 602 gpu::Capabilities InProcessCommandBuffer::GetCapabilities() { |
| 603 return capabilities_; | 603 return capabilities_; |
| 604 } | 604 } |
| 605 | 605 |
| 606 gfx::GpuMemoryBuffer* InProcessCommandBuffer::CreateGpuMemoryBuffer( | 606 gfx::GpuMemoryBuffer* InProcessCommandBuffer::CreateGpuMemoryBuffer( |
| 607 size_t width, | 607 size_t width, |
| 608 size_t height, | 608 size_t height, |
| 609 unsigned internalformat, | 609 unsigned internalformat, |
| 610 unsigned usage, |
| 610 int32* id) { | 611 int32* id) { |
| 611 CheckSequencedThread(); | 612 CheckSequencedThread(); |
| 612 | 613 |
| 613 *id = -1; | 614 *id = -1; |
| 614 linked_ptr<gfx::GpuMemoryBuffer> buffer = | 615 linked_ptr<gfx::GpuMemoryBuffer> buffer = |
| 615 make_linked_ptr(g_gpu_memory_buffer_factory->CreateGpuMemoryBuffer( | 616 make_linked_ptr(g_gpu_memory_buffer_factory->CreateGpuMemoryBuffer( |
| 616 width, height, internalformat)); | 617 width, height, internalformat, usage)); |
| 617 if (!buffer.get()) | 618 if (!buffer.get()) |
| 618 return NULL; | 619 return NULL; |
| 619 | 620 |
| 620 static int32 next_id = 1; | 621 static int32 next_id = 1; |
| 621 *id = next_id++; | 622 *id = next_id++; |
| 622 | 623 |
| 623 base::Closure task = base::Bind(&GpuControlService::RegisterGpuMemoryBuffer, | 624 base::Closure task = base::Bind(&GpuControlService::RegisterGpuMemoryBuffer, |
| 624 base::Unretained(gpu_control_.get()), | 625 base::Unretained(gpu_control_.get()), |
| 625 *id, | 626 *id, |
| 626 buffer->GetHandle(), | 627 buffer->GetHandle(), |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 776 } | 777 } |
| 777 #endif | 778 #endif |
| 778 | 779 |
| 779 // static | 780 // static |
| 780 void InProcessCommandBuffer::SetGpuMemoryBufferFactory( | 781 void InProcessCommandBuffer::SetGpuMemoryBufferFactory( |
| 781 GpuMemoryBufferFactory* factory) { | 782 GpuMemoryBufferFactory* factory) { |
| 782 g_gpu_memory_buffer_factory = factory; | 783 g_gpu_memory_buffer_factory = factory; |
| 783 } | 784 } |
| 784 | 785 |
| 785 } // namespace gpu | 786 } // namespace gpu |
| OLD | NEW |