Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(374)

Side by Side Diff: gpu/command_buffer/service/in_process_command_buffer.cc

Issue 1051503003: Add R_8 GPU memory buffers format. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merged on master. Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/image_factory.cc ('k') | gpu/command_buffer/tests/gl_gpu_memory_buffer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698