| 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 1019 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1030 | 1030 |
| 1031 scoped_refptr<gfx::GLImage> GpuChannel::CreateImageForGpuMemoryBuffer( | 1031 scoped_refptr<gfx::GLImage> GpuChannel::CreateImageForGpuMemoryBuffer( |
| 1032 const gfx::GpuMemoryBufferHandle& handle, | 1032 const gfx::GpuMemoryBufferHandle& handle, |
| 1033 const gfx::Size& size, | 1033 const gfx::Size& size, |
| 1034 gfx::BufferFormat format, | 1034 gfx::BufferFormat format, |
| 1035 uint32 internalformat) { | 1035 uint32 internalformat) { |
| 1036 switch (handle.type) { | 1036 switch (handle.type) { |
| 1037 case gfx::SHARED_MEMORY_BUFFER: { | 1037 case gfx::SHARED_MEMORY_BUFFER: { |
| 1038 scoped_refptr<gfx::GLImageSharedMemory> image( | 1038 scoped_refptr<gfx::GLImageSharedMemory> image( |
| 1039 new gfx::GLImageSharedMemory(size, internalformat)); | 1039 new gfx::GLImageSharedMemory(size, internalformat)); |
| 1040 if (!image->Initialize(handle.handle, handle.id, format)) | 1040 if (!image->Initialize(handle, format)) |
| 1041 return scoped_refptr<gfx::GLImage>(); | 1041 return scoped_refptr<gfx::GLImage>(); |
| 1042 | 1042 |
| 1043 return image; | 1043 return image; |
| 1044 } | 1044 } |
| 1045 default: { | 1045 default: { |
| 1046 GpuChannelManager* manager = gpu_channel_manager(); | 1046 GpuChannelManager* manager = gpu_channel_manager(); |
| 1047 if (!manager->gpu_memory_buffer_factory()) | 1047 if (!manager->gpu_memory_buffer_factory()) |
| 1048 return scoped_refptr<gfx::GLImage>(); | 1048 return scoped_refptr<gfx::GLImage>(); |
| 1049 | 1049 |
| 1050 return manager->gpu_memory_buffer_factory() | 1050 return manager->gpu_memory_buffer_factory() |
| 1051 ->AsImageFactory() | 1051 ->AsImageFactory() |
| 1052 ->CreateImageForGpuMemoryBuffer(handle, | 1052 ->CreateImageForGpuMemoryBuffer(handle, |
| 1053 size, | 1053 size, |
| 1054 format, | 1054 format, |
| 1055 internalformat, | 1055 internalformat, |
| 1056 client_id_); | 1056 client_id_); |
| 1057 } | 1057 } |
| 1058 } | 1058 } |
| 1059 } | 1059 } |
| 1060 | 1060 |
| 1061 void GpuChannel::HandleUpdateValueState( | 1061 void GpuChannel::HandleUpdateValueState( |
| 1062 unsigned int target, const gpu::ValueState& state) { | 1062 unsigned int target, const gpu::ValueState& state) { |
| 1063 pending_valuebuffer_state_->UpdateState(target, state); | 1063 pending_valuebuffer_state_->UpdateState(target, state); |
| 1064 } | 1064 } |
| 1065 | 1065 |
| 1066 } // namespace content | 1066 } // namespace content |
| OLD | NEW |