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