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/ipc/in_process_command_buffer.h" | 5 #include "gpu/ipc/in_process_command_buffer.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <queue> | 10 #include <queue> |
(...skipping 689 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
700 unsigned internalformat) { | 700 unsigned internalformat) { |
701 CheckSequencedThread(); | 701 CheckSequencedThread(); |
702 | 702 |
703 DCHECK(gpu_memory_buffer_manager_); | 703 DCHECK(gpu_memory_buffer_manager_); |
704 gfx::GpuMemoryBuffer* gpu_memory_buffer = | 704 gfx::GpuMemoryBuffer* gpu_memory_buffer = |
705 reinterpret_cast<gfx::GpuMemoryBuffer*>(buffer); | 705 reinterpret_cast<gfx::GpuMemoryBuffer*>(buffer); |
706 DCHECK(gpu_memory_buffer); | 706 DCHECK(gpu_memory_buffer); |
707 | 707 |
708 int32_t new_id = next_image_id_.GetNext(); | 708 int32_t new_id = next_image_id_.GetNext(); |
709 | 709 |
710 DCHECK(gpu::IsGpuMemoryBufferFormatSupported(gpu_memory_buffer->GetFormat(), | 710 DCHECK(gpu::IsImageFromGpuMemoryBufferFormatSupported( |
711 capabilities_)); | 711 gpu_memory_buffer->GetFormat(), capabilities_)); |
712 DCHECK(gpu::IsImageFormatCompatibleWithGpuMemoryBufferFormat( | 712 DCHECK(gpu::IsImageFormatCompatibleWithGpuMemoryBufferFormat( |
713 internalformat, gpu_memory_buffer->GetFormat())); | 713 internalformat, gpu_memory_buffer->GetFormat())); |
714 | 714 |
715 // This handle is owned by the GPU thread and must be passed to it or it | 715 // This handle is owned by the GPU thread and must be passed to it or it |
716 // will leak. In otherwords, do not early out on error between here and the | 716 // will leak. In otherwords, do not early out on error between here and the |
717 // queuing of the CreateImage task below. | 717 // queuing of the CreateImage task below. |
718 gfx::GpuMemoryBufferHandle handle = | 718 gfx::GpuMemoryBufferHandle handle = |
719 gfx::CloneHandleForIPC(gpu_memory_buffer->GetHandle()); | 719 gfx::CloneHandleForIPC(gpu_memory_buffer->GetHandle()); |
720 bool requires_sync_point = handle.type == gfx::IO_SURFACE_BUFFER; | 720 bool requires_sync_point = handle.type == gfx::IO_SURFACE_BUFFER; |
721 | 721 |
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1124 return wrapped_callback; | 1124 return wrapped_callback; |
1125 } | 1125 } |
1126 | 1126 |
1127 InProcessCommandBuffer::GpuTask::GpuTask(const base::Closure& callback, | 1127 InProcessCommandBuffer::GpuTask::GpuTask(const base::Closure& callback, |
1128 uint32_t order_number) | 1128 uint32_t order_number) |
1129 : callback(callback), order_number(order_number) {} | 1129 : callback(callback), order_number(order_number) {} |
1130 | 1130 |
1131 InProcessCommandBuffer::GpuTask::~GpuTask() {} | 1131 InProcessCommandBuffer::GpuTask::~GpuTask() {} |
1132 | 1132 |
1133 } // namespace gpu | 1133 } // namespace gpu |
OLD | NEW |