sandbox/linux/bpf_dsl: eliminate implicit dependency on C++ compiler behavior
[chromium-blink-merge.git] / content / browser / compositor / surface_utils.cc
blob78f63a0d64746150668f9694b721ca114ef91057
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"
11 #else
12 #include "content/browser/compositor/image_transport_factory.h"
13 #include "ui/compositor/compositor.h"
14 #endif
16 namespace content {
18 scoped_ptr<cc::SurfaceIdAllocator> CreateSurfaceIdAllocator() {
19 #if defined(OS_ANDROID)
20 return CompositorImpl::CreateSurfaceIdAllocator();
21 #else
22 ImageTransportFactory* factory = ImageTransportFactory::GetInstance();
23 return factory->GetContextFactory()->CreateSurfaceIdAllocator();
24 #endif
27 cc::SurfaceManager* GetSurfaceManager() {
28 #if defined(OS_ANDROID)
29 return CompositorImpl::GetSurfaceManager();
30 #else
31 ImageTransportFactory* factory = ImageTransportFactory::GetInstance();
32 return factory->GetSurfaceManager();
33 #endif
36 } // namespace content