| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_memory_buffer_factory.h" | 5 #include "content/common/gpu/gpu_memory_buffer_factory.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
| 9 | 9 |
| 10 #if defined(OS_MACOSX) | 10 #if defined(OS_MACOSX) |
| 11 #include "content/common/gpu/gpu_memory_buffer_factory_io_surface.h" | 11 #include "content/common/gpu/gpu_memory_buffer_factory_io_surface.h" |
| 12 #endif | 12 #endif |
| 13 | 13 |
| 14 #if defined(OS_ANDROID) | 14 #if defined(OS_ANDROID) |
| 15 #include "content/common/gpu/gpu_memory_buffer_factory_surface_texture.h" | 15 #include "content/common/gpu/gpu_memory_buffer_factory_surface_texture.h" |
| 16 #endif | 16 #endif |
| 17 | 17 |
| 18 #if defined(USE_OZONE) | 18 #if defined(USE_OZONE) |
| 19 #include "content/common/gpu/gpu_memory_buffer_factory_ozone_native_pixmap.h" | 19 #include "content/common/gpu/gpu_memory_buffer_factory_ozone_native_pixmap.h" |
| 20 #endif | 20 #endif |
| 21 | 21 |
| 22 namespace content { | 22 namespace content { |
| 23 | 23 |
| 24 // static | 24 // static |
| 25 gfx::GpuMemoryBufferType GpuMemoryBufferFactory::GetNativeType() { | |
| 26 #if defined(OS_MACOSX) | |
| 27 return gfx::IO_SURFACE_BUFFER; | |
| 28 #endif | |
| 29 #if defined(OS_ANDROID) | |
| 30 return gfx::SURFACE_TEXTURE_BUFFER; | |
| 31 #endif | |
| 32 #if defined(USE_OZONE) | |
| 33 return gfx::OZONE_NATIVE_PIXMAP; | |
| 34 #endif | |
| 35 return gfx::EMPTY_BUFFER; | |
| 36 } | |
| 37 | |
| 38 // static | |
| 39 scoped_ptr<GpuMemoryBufferFactory> GpuMemoryBufferFactory::CreateNativeType() { | 25 scoped_ptr<GpuMemoryBufferFactory> GpuMemoryBufferFactory::CreateNativeType() { |
| 40 #if defined(OS_MACOSX) | 26 #if defined(OS_MACOSX) |
| 41 return make_scoped_ptr(new GpuMemoryBufferFactoryIOSurface); | 27 return make_scoped_ptr(new GpuMemoryBufferFactoryIOSurface); |
| 42 #endif | 28 #endif |
| 43 #if defined(OS_ANDROID) | 29 #if defined(OS_ANDROID) |
| 44 return make_scoped_ptr(new GpuMemoryBufferFactorySurfaceTexture); | 30 return make_scoped_ptr(new GpuMemoryBufferFactorySurfaceTexture); |
| 45 #endif | 31 #endif |
| 46 #if defined(USE_OZONE) | 32 #if defined(USE_OZONE) |
| 47 return make_scoped_ptr(new GpuMemoryBufferFactoryOzoneNativePixmap); | 33 return make_scoped_ptr(new GpuMemoryBufferFactoryOzoneNativePixmap); |
| 48 #endif | 34 #endif |
| 49 NOTREACHED(); | 35 NOTREACHED(); |
| 50 return nullptr; | 36 return nullptr; |
| 51 } | 37 } |
| 52 | 38 |
| 53 } // namespace content | 39 } // namespace content |
| OLD | NEW |