| 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 "content/common/gpu/client/gpu_memory_buffer_impl.h" | 5 #include "content/common/gpu/client/gpu_memory_buffer_impl.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "content/common/gpu/client/gpu_memory_buffer_impl_io_surface.h" | 8 #include "content/common/gpu/client/gpu_memory_buffer_impl_io_surface.h" |
| 9 #include "content/common/gpu/client/gpu_memory_buffer_impl_shared_memory.h" | 9 #include "content/common/gpu/client/gpu_memory_buffer_impl_shared_memory.h" |
| 10 | 10 |
| 11 namespace content { | 11 namespace content { |
| 12 | 12 |
| 13 // static | 13 // static |
| 14 void GpuMemoryBufferImpl::GetSupportedTypes( | 14 void GpuMemoryBufferImpl::GetSupportedTypes( |
| 15 std::vector<gfx::GpuMemoryBufferType>* types) { | 15 std::vector<gfx::GpuMemoryBufferType>* types) { |
| 16 const gfx::GpuMemoryBufferType supported_types[] = { | 16 const gfx::GpuMemoryBufferType supported_types[] = { |
| 17 gfx::IO_SURFACE_BUFFER, | 17 gfx::SHARED_MEMORY_BUFFER, |
| 18 gfx::SHARED_MEMORY_BUFFER | 18 gfx::IO_SURFACE_BUFFER |
| 19 }; | 19 }; |
| 20 types->assign(supported_types, supported_types + arraysize(supported_types)); | 20 types->assign(supported_types, supported_types + arraysize(supported_types)); |
| 21 } | 21 } |
| 22 | 22 |
| 23 // static | 23 // static |
| 24 bool GpuMemoryBufferImpl::IsConfigurationSupported( | 24 bool GpuMemoryBufferImpl::IsConfigurationSupported( |
| 25 gfx::GpuMemoryBufferType type, | 25 gfx::GpuMemoryBufferType type, |
| 26 Format format, | 26 Format format, |
| 27 Usage usage) { | 27 Usage usage) { |
| 28 switch (type) { | 28 switch (type) { |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 case gfx::IO_SURFACE_BUFFER: | 118 case gfx::IO_SURFACE_BUFFER: |
| 119 return GpuMemoryBufferImplIOSurface::CreateFromHandle( | 119 return GpuMemoryBufferImplIOSurface::CreateFromHandle( |
| 120 handle, size, format, callback); | 120 handle, size, format, callback); |
| 121 default: | 121 default: |
| 122 NOTREACHED(); | 122 NOTREACHED(); |
| 123 return scoped_ptr<GpuMemoryBufferImpl>(); | 123 return scoped_ptr<GpuMemoryBufferImpl>(); |
| 124 } | 124 } |
| 125 } | 125 } |
| 126 | 126 |
| 127 } // namespace content | 127 } // namespace content |
| OLD | NEW |