Chromium Code Reviews| 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 <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include <GLES2/gl2.h> | 10 #include <GLES2/gl2.h> |
| (...skipping 621 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 632 id); | 632 id); |
| 633 | 633 |
| 634 QueueTask(task); | 634 QueueTask(task); |
| 635 } | 635 } |
| 636 | 636 |
| 637 gpu::Buffer InProcessCommandBuffer::GetTransferBuffer(int32 id) { | 637 gpu::Buffer InProcessCommandBuffer::GetTransferBuffer(int32 id) { |
| 638 NOTREACHED(); | 638 NOTREACHED(); |
| 639 return gpu::Buffer(); | 639 return gpu::Buffer(); |
| 640 } | 640 } |
| 641 | 641 |
| 642 uint32 InProcessCommandBuffer::InsertSyncPoint() { | |
| 643 NOTREACHED(); | |
| 644 return 0; | |
| 645 } | |
| 646 void InProcessCommandBuffer::SignalSyncPoint(unsigned sync_point, | |
| 647 const base::Closure& callback) { | |
| 648 CheckSequencedThread(); | |
| 649 QueueTask(WrapCallback(callback)); | |
| 650 } | |
| 651 | |
| 652 bool InProcessCommandBuffer::SupportsGpuMemoryBuffer() { | 642 bool InProcessCommandBuffer::SupportsGpuMemoryBuffer() { |
| 653 return supports_gpu_memory_buffer_; | 643 return supports_gpu_memory_buffer_; |
| 654 } | 644 } |
| 655 | 645 |
| 656 gfx::GpuMemoryBuffer* InProcessCommandBuffer::CreateGpuMemoryBuffer( | 646 gfx::GpuMemoryBuffer* InProcessCommandBuffer::CreateGpuMemoryBuffer( |
| 657 size_t width, | 647 size_t width, |
| 658 size_t height, | 648 size_t height, |
| 659 unsigned internalformat, | 649 unsigned internalformat, |
| 660 int32* id) { | 650 int32* id) { |
| 661 CheckSequencedThread(); | 651 CheckSequencedThread(); |
| 662 base::AutoLock lock(command_buffer_lock_); | 652 base::AutoLock lock(command_buffer_lock_); |
| 663 return gpu_control_->CreateGpuMemoryBuffer(width, | 653 return gpu_control_->CreateGpuMemoryBuffer(width, |
| 664 height, | 654 height, |
| 665 internalformat, | 655 internalformat, |
| 666 id); | 656 id); |
| 667 } | 657 } |
| 668 | 658 |
| 669 void InProcessCommandBuffer::DestroyGpuMemoryBuffer(int32 id) { | 659 void InProcessCommandBuffer::DestroyGpuMemoryBuffer(int32 id) { |
| 670 CheckSequencedThread(); | 660 CheckSequencedThread(); |
| 671 base::Closure task = base::Bind(&GpuControl::DestroyGpuMemoryBuffer, | 661 base::Closure task = base::Bind(&GpuControl::DestroyGpuMemoryBuffer, |
| 672 base::Unretained(gpu_control_.get()), | 662 base::Unretained(gpu_control_.get()), |
| 673 id); | 663 id); |
| 674 | 664 |
| 675 QueueTask(task); | 665 QueueTask(task); |
| 676 } | 666 } |
| 677 | 667 |
| 668 uint32 InProcessCommandBuffer::InsertSyncPoint() { | |
| 669 NOTREACHED(); | |
|
piman
2013/09/27 01:35:47
If you want to merge the WGC3D implementations and
| |
| 670 return 0; | |
| 671 } | |
| 672 | |
| 673 void InProcessCommandBuffer::SignalSyncPoint(unsigned sync_point, | |
| 674 const base::Closure& callback) { | |
| 675 CheckSequencedThread(); | |
| 676 QueueTask(WrapCallback(callback)); | |
| 677 } | |
| 678 | |
| 678 gpu::error::Error InProcessCommandBuffer::GetLastError() { | 679 gpu::error::Error InProcessCommandBuffer::GetLastError() { |
| 679 CheckSequencedThread(); | 680 CheckSequencedThread(); |
| 680 return last_state_.error; | 681 return last_state_.error; |
| 681 } | 682 } |
| 682 | 683 |
| 683 bool InProcessCommandBuffer::Initialize() { | 684 bool InProcessCommandBuffer::Initialize() { |
| 684 NOTREACHED(); | 685 NOTREACHED(); |
| 685 return false; | 686 return false; |
| 686 } | 687 } |
| 687 | 688 |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 756 g_gpu_queue.Get().RunTasks(); | 757 g_gpu_queue.Get().RunTasks(); |
| 757 } | 758 } |
| 758 | 759 |
| 759 // static | 760 // static |
| 760 void InProcessCommandBuffer::SetGpuMemoryBufferFactory( | 761 void InProcessCommandBuffer::SetGpuMemoryBufferFactory( |
| 761 GpuMemoryBufferFactory* factory) { | 762 GpuMemoryBufferFactory* factory) { |
| 762 g_gpu_memory_buffer_factory = factory; | 763 g_gpu_memory_buffer_factory = factory; |
| 763 } | 764 } |
| 764 | 765 |
| 765 } // namespace gpu | 766 } // namespace gpu |
| OLD | NEW |