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
3 // found in the LICENSE file.
5 #include "content/browser/compositor/surface_utils.h"
7 #include "cc/surfaces/surface_id_allocator.h"
9 #if defined(OS_ANDROID)
10 #include "content/browser/renderer_host/compositor_impl_android.h"
12 #include "content/browser/compositor/image_transport_factory.h"
13 #include "ui/compositor/compositor.h"
18 scoped_ptr
<cc::SurfaceIdAllocator
> CreateSurfaceIdAllocator() {
19 #if defined(OS_ANDROID)
20 return CompositorImpl::CreateSurfaceIdAllocator();
22 ImageTransportFactory
* factory
= ImageTransportFactory::GetInstance();
23 return factory
->GetContextFactory()->CreateSurfaceIdAllocator();
27 cc::SurfaceManager
* GetSurfaceManager() {
28 #if defined(OS_ANDROID)
29 return CompositorImpl::GetSurfaceManager();
31 ImageTransportFactory
* factory
= ImageTransportFactory::GetInstance();
32 return factory
->GetSurfaceManager();
36 } // namespace content