| 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 "gpu/ipc/service/gpu_memory_buffer_factory.h" | 5 #include "gpu/ipc/service/gpu_memory_buffer_factory.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
| 9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
| 10 | 10 |
| 11 #if defined(OS_MACOSX) | 11 #if defined(OS_MACOSX) |
| 12 #include "gpu/ipc/service/gpu_memory_buffer_factory_io_surface.h" | 12 #include "gpu/ipc/service/gpu_memory_buffer_factory_io_surface.h" |
| 13 #endif | 13 #endif |
| 14 | 14 |
| 15 #if defined(OS_ANDROID) | |
| 16 #include "gpu/ipc/service/gpu_memory_buffer_factory_surface_texture.h" | |
| 17 #endif | |
| 18 | |
| 19 #if defined(USE_OZONE) | 15 #if defined(USE_OZONE) |
| 20 #include "gpu/ipc/service/gpu_memory_buffer_factory_ozone_native_pixmap.h" | 16 #include "gpu/ipc/service/gpu_memory_buffer_factory_ozone_native_pixmap.h" |
| 21 #endif | 17 #endif |
| 22 | 18 |
| 23 namespace gpu { | 19 namespace gpu { |
| 24 | 20 |
| 25 // static | 21 // static |
| 26 std::unique_ptr<GpuMemoryBufferFactory> | 22 std::unique_ptr<GpuMemoryBufferFactory> |
| 27 GpuMemoryBufferFactory::CreateNativeType() { | 23 GpuMemoryBufferFactory::CreateNativeType() { |
| 28 #if defined(OS_MACOSX) | 24 #if defined(OS_MACOSX) |
| 29 return base::WrapUnique(new GpuMemoryBufferFactoryIOSurface); | 25 return base::WrapUnique(new GpuMemoryBufferFactoryIOSurface); |
| 30 #endif | 26 #endif |
| 31 #if defined(OS_ANDROID) | |
| 32 return base::WrapUnique(new GpuMemoryBufferFactorySurfaceTexture); | |
| 33 #endif | |
| 34 #if defined(USE_OZONE) | 27 #if defined(USE_OZONE) |
| 35 return base::WrapUnique(new GpuMemoryBufferFactoryOzoneNativePixmap); | 28 return base::WrapUnique(new GpuMemoryBufferFactoryOzoneNativePixmap); |
| 36 #endif | 29 #endif |
| 37 NOTREACHED(); | 30 NOTREACHED(); |
| 38 return nullptr; | 31 return nullptr; |
| 39 } | 32 } |
| 40 | 33 |
| 41 } // namespace gpu | 34 } // namespace gpu |
| OLD | NEW |