| 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 695 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 706 unsigned internalformat) { | 706 unsigned internalformat) { |
| 707 CheckSequencedThread(); | 707 CheckSequencedThread(); |
| 708 | 708 |
| 709 DCHECK(gpu_memory_buffer_manager_); | 709 DCHECK(gpu_memory_buffer_manager_); |
| 710 gfx::GpuMemoryBuffer* gpu_memory_buffer = | 710 gfx::GpuMemoryBuffer* gpu_memory_buffer = |
| 711 gpu_memory_buffer_manager_->GpuMemoryBufferFromClientBuffer(buffer); | 711 gpu_memory_buffer_manager_->GpuMemoryBufferFromClientBuffer(buffer); |
| 712 DCHECK(gpu_memory_buffer); | 712 DCHECK(gpu_memory_buffer); |
| 713 | 713 |
| 714 int32 new_id = next_image_id_.GetNext(); | 714 int32 new_id = next_image_id_.GetNext(); |
| 715 | 715 |
| 716 DCHECK(gpu::ImageFactory::IsGpuMemoryBufferFormatSupported( |
| 717 gpu_memory_buffer->GetFormat(), capabilities_)); |
| 716 DCHECK(gpu::ImageFactory::IsImageFormatCompatibleWithGpuMemoryBufferFormat( | 718 DCHECK(gpu::ImageFactory::IsImageFormatCompatibleWithGpuMemoryBufferFormat( |
| 717 internalformat, gpu_memory_buffer->GetFormat())); | 719 internalformat, gpu_memory_buffer->GetFormat())); |
| 718 | 720 |
| 719 // This handle is owned by the GPU thread and must be passed to it or it | 721 // This handle is owned by the GPU thread and must be passed to it or it |
| 720 // will leak. In otherwords, do not early out on error between here and the | 722 // will leak. In otherwords, do not early out on error between here and the |
| 721 // queuing of the CreateImage task below. | 723 // queuing of the CreateImage task below. |
| 722 bool requires_sync_point = false; | 724 bool requires_sync_point = false; |
| 723 gfx::GpuMemoryBufferHandle handle = | 725 gfx::GpuMemoryBufferHandle handle = |
| 724 ShareGpuMemoryBufferToGpuThread(gpu_memory_buffer->GetHandle(), | 726 ShareGpuMemoryBufferToGpuThread(gpu_memory_buffer->GetHandle(), |
| 725 &requires_sync_point); | 727 &requires_sync_point); |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 961 | 963 |
| 962 #if defined(OS_ANDROID) | 964 #if defined(OS_ANDROID) |
| 963 scoped_refptr<gfx::SurfaceTexture> | 965 scoped_refptr<gfx::SurfaceTexture> |
| 964 InProcessCommandBuffer::GetSurfaceTexture(uint32 stream_id) { | 966 InProcessCommandBuffer::GetSurfaceTexture(uint32 stream_id) { |
| 965 DCHECK(stream_texture_manager_); | 967 DCHECK(stream_texture_manager_); |
| 966 return stream_texture_manager_->GetSurfaceTexture(stream_id); | 968 return stream_texture_manager_->GetSurfaceTexture(stream_id); |
| 967 } | 969 } |
| 968 #endif | 970 #endif |
| 969 | 971 |
| 970 } // namespace gpu | 972 } // namespace gpu |
| OLD | NEW |