Line data Source code
1 : /* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 : * This Source Code Form is subject to the terms of the Mozilla Public
3 : * License, v. 2.0. If a copy of the MPL was not distributed with this
4 : * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 :
6 : #include "TextureHostBasic.h"
7 : #ifdef XP_MACOSX
8 : #include "MacIOSurfaceTextureHostBasic.h"
9 : #endif
10 :
11 : using namespace mozilla::gl;
12 : using namespace mozilla::gfx;
13 :
14 : namespace mozilla {
15 : namespace layers {
16 :
17 : already_AddRefed<TextureHost>
18 0 : CreateTextureHostBasic(const SurfaceDescriptor& aDesc,
19 : ISurfaceAllocator* aDeallocator,
20 : LayersBackend aBackend,
21 : TextureFlags aFlags)
22 : {
23 : #ifdef XP_MACOSX
24 : if (aDesc.type() == SurfaceDescriptor::TSurfaceDescriptorMacIOSurface) {
25 : const SurfaceDescriptorMacIOSurface& desc =
26 : aDesc.get_SurfaceDescriptorMacIOSurface();
27 : return MakeAndAddRef<MacIOSurfaceTextureHostBasic>(aFlags, desc);
28 : }
29 : #endif
30 0 : return CreateBackendIndependentTextureHost(aDesc, aDeallocator, aBackend, aFlags);
31 : }
32 :
33 : } // namespace layers
34 : } // namespace mozilla
|