2013-12-04 04:20:04 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
2017-10-28 01:55:37 +03:00
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2013-12-04 04:20:04 +04:00
|
|
|
|
|
|
|
#include "TextureHostBasic.h"
|
2014-07-22 19:29:33 +04:00
|
|
|
#ifdef XP_MACOSX
|
2013-12-04 04:20:04 +04:00
|
|
|
#include "MacIOSurfaceTextureHostBasic.h"
|
2014-07-22 19:29:33 +04:00
|
|
|
#endif
|
2013-12-04 04:20:04 +04:00
|
|
|
|
|
|
|
using namespace mozilla::gl;
|
|
|
|
using namespace mozilla::gfx;
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace layers {
|
|
|
|
|
2015-06-17 17:00:52 +03:00
|
|
|
already_AddRefed<TextureHost>
|
2013-12-12 05:44:47 +04:00
|
|
|
CreateTextureHostBasic(const SurfaceDescriptor& aDesc,
|
2013-12-04 04:20:04 +04:00
|
|
|
ISurfaceAllocator* aDeallocator,
|
2017-03-07 13:37:28 +03:00
|
|
|
LayersBackend aBackend,
|
2013-12-04 04:20:04 +04:00
|
|
|
TextureFlags aFlags)
|
|
|
|
{
|
|
|
|
#ifdef XP_MACOSX
|
2014-01-09 18:26:20 +04:00
|
|
|
if (aDesc.type() == SurfaceDescriptor::TSurfaceDescriptorMacIOSurface) {
|
|
|
|
const SurfaceDescriptorMacIOSurface& desc =
|
|
|
|
aDesc.get_SurfaceDescriptorMacIOSurface();
|
2015-05-01 16:14:16 +03:00
|
|
|
return MakeAndAddRef<MacIOSurfaceTextureHostBasic>(aFlags, desc);
|
2013-12-04 04:20:04 +04:00
|
|
|
}
|
2014-01-09 18:26:20 +04:00
|
|
|
#endif
|
2017-03-07 13:37:28 +03:00
|
|
|
return CreateBackendIndependentTextureHost(aDesc, aDeallocator, aBackend, aFlags);
|
2013-12-04 04:20:04 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace layers
|
2015-07-13 18:25:42 +03:00
|
|
|
} // namespace mozilla
|