| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/browser/compositor/surface_utils.h" | 5 #include "content/browser/compositor/surface_utils.h" |
| 6 | 6 |
| 7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
| 8 #include "cc/surfaces/surface_id_allocator.h" | 8 #include "cc/surfaces/surface_id_allocator.h" |
| 9 | 9 |
| 10 #if defined(OS_ANDROID) && !defined(USE_AURA) | 10 #if defined(OS_ANDROID) |
| 11 #include "content/browser/renderer_host/compositor_impl_android.h" | 11 #include "content/browser/renderer_host/compositor_impl_android.h" |
| 12 #else | 12 #else |
| 13 #include "content/browser/compositor/image_transport_factory.h" | 13 #include "content/browser/compositor/image_transport_factory.h" |
| 14 #include "ui/compositor/compositor.h" | 14 #include "ui/compositor/compositor.h" |
| 15 #endif | 15 #endif |
| 16 | 16 |
| 17 namespace content { | 17 namespace content { |
| 18 | 18 |
| 19 scoped_ptr<cc::SurfaceIdAllocator> CreateSurfaceIdAllocator() { | 19 scoped_ptr<cc::SurfaceIdAllocator> CreateSurfaceIdAllocator() { |
| 20 #if defined(OS_ANDROID) && !defined(USE_AURA) | 20 #if defined(OS_ANDROID) |
| 21 return CompositorImpl::CreateSurfaceIdAllocator(); | 21 return CompositorImpl::CreateSurfaceIdAllocator(); |
| 22 #else | 22 #else |
| 23 ImageTransportFactory* factory = ImageTransportFactory::GetInstance(); | 23 ImageTransportFactory* factory = ImageTransportFactory::GetInstance(); |
| 24 return factory->GetContextFactory()->CreateSurfaceIdAllocator(); | 24 return factory->GetContextFactory()->CreateSurfaceIdAllocator(); |
| 25 #endif | 25 #endif |
| 26 } | 26 } |
| 27 | 27 |
| 28 cc::SurfaceManager* GetSurfaceManager() { | 28 cc::SurfaceManager* GetSurfaceManager() { |
| 29 #if defined(OS_ANDROID) && !defined(USE_AURA) | 29 #if defined(OS_ANDROID) |
| 30 return CompositorImpl::GetSurfaceManager(); | 30 return CompositorImpl::GetSurfaceManager(); |
| 31 #else | 31 #else |
| 32 ImageTransportFactory* factory = ImageTransportFactory::GetInstance(); | 32 ImageTransportFactory* factory = ImageTransportFactory::GetInstance(); |
| 33 return factory->GetSurfaceManager(); | 33 return factory->GetSurfaceManager(); |
| 34 #endif | 34 #endif |
| 35 } | 35 } |
| 36 | 36 |
| 37 } // namespace content | 37 } // namespace content |
| OLD | NEW |