| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/common/gpu/gpu_channel.h" | 5 #include "content/common/gpu/gpu_channel.h" |
| 6 | 6 |
| 7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
| 8 #include <windows.h> | 8 #include <windows.h> |
| 9 #endif | 9 #endif |
| 10 | 10 |
| (...skipping 1024 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1035 | 1035 |
| 1036 scoped_refptr<gfx::GLImage> GpuChannel::CreateImageForGpuMemoryBuffer( | 1036 scoped_refptr<gfx::GLImage> GpuChannel::CreateImageForGpuMemoryBuffer( |
| 1037 const gfx::GpuMemoryBufferHandle& handle, | 1037 const gfx::GpuMemoryBufferHandle& handle, |
| 1038 const gfx::Size& size, | 1038 const gfx::Size& size, |
| 1039 gfx::BufferFormat format, | 1039 gfx::BufferFormat format, |
| 1040 uint32 internalformat) { | 1040 uint32 internalformat) { |
| 1041 switch (handle.type) { | 1041 switch (handle.type) { |
| 1042 case gfx::SHARED_MEMORY_BUFFER: { | 1042 case gfx::SHARED_MEMORY_BUFFER: { |
| 1043 scoped_refptr<gfx::GLImageSharedMemory> image( | 1043 scoped_refptr<gfx::GLImageSharedMemory> image( |
| 1044 new gfx::GLImageSharedMemory(size, internalformat)); | 1044 new gfx::GLImageSharedMemory(size, internalformat)); |
| 1045 if (!image->Initialize(handle, format)) | 1045 if (!image->Initialize(handle.handle, handle.id, format)) |
| 1046 return scoped_refptr<gfx::GLImage>(); | 1046 return scoped_refptr<gfx::GLImage>(); |
| 1047 | 1047 |
| 1048 return image; | 1048 return image; |
| 1049 } | 1049 } |
| 1050 default: { | 1050 default: { |
| 1051 GpuChannelManager* manager = gpu_channel_manager(); | 1051 GpuChannelManager* manager = gpu_channel_manager(); |
| 1052 if (!manager->gpu_memory_buffer_factory()) | 1052 if (!manager->gpu_memory_buffer_factory()) |
| 1053 return scoped_refptr<gfx::GLImage>(); | 1053 return scoped_refptr<gfx::GLImage>(); |
| 1054 | 1054 |
| 1055 return manager->gpu_memory_buffer_factory() | 1055 return manager->gpu_memory_buffer_factory() |
| 1056 ->AsImageFactory() | 1056 ->AsImageFactory() |
| 1057 ->CreateImageForGpuMemoryBuffer(handle, | 1057 ->CreateImageForGpuMemoryBuffer(handle, |
| 1058 size, | 1058 size, |
| 1059 format, | 1059 format, |
| 1060 internalformat, | 1060 internalformat, |
| 1061 client_id_); | 1061 client_id_); |
| 1062 } | 1062 } |
| 1063 } | 1063 } |
| 1064 } | 1064 } |
| 1065 | 1065 |
| 1066 void GpuChannel::HandleUpdateValueState( | 1066 void GpuChannel::HandleUpdateValueState( |
| 1067 unsigned int target, const gpu::ValueState& state) { | 1067 unsigned int target, const gpu::ValueState& state) { |
| 1068 pending_valuebuffer_state_->UpdateState(target, state); | 1068 pending_valuebuffer_state_->UpdateState(target, state); |
| 1069 } | 1069 } |
| 1070 | 1070 |
| 1071 } // namespace content | 1071 } // namespace content |
| OLD | NEW |