2013-12-03 16:20:04 -08:00
|
|
|
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
|
|
|
* 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/. */
|
|
|
|
|
|
|
|
#include "TextureHostBasic.h"
|
|
|
|
#include "MacIOSurfaceTextureHostBasic.h"
|
|
|
|
|
|
|
|
using namespace mozilla::gl;
|
|
|
|
using namespace mozilla::gfx;
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace layers {
|
|
|
|
|
|
|
|
TemporaryRef<TextureHost>
|
2013-12-11 17:44:47 -08:00
|
|
|
CreateTextureHostBasic(const SurfaceDescriptor& aDesc,
|
2013-12-03 16:20:04 -08:00
|
|
|
ISurfaceAllocator* aDeallocator,
|
|
|
|
TextureFlags aFlags)
|
|
|
|
{
|
|
|
|
RefPtr<TextureHost> result;
|
|
|
|
switch (aDesc.type()) {
|
|
|
|
#ifdef XP_MACOSX
|
|
|
|
case SurfaceDescriptor::TSurfaceDescriptorMacIOSurface: {
|
|
|
|
const SurfaceDescriptorMacIOSurface& desc =
|
|
|
|
aDesc.get_SurfaceDescriptorMacIOSurface();
|
2013-12-11 17:44:47 -08:00
|
|
|
result = new MacIOSurfaceTextureHostBasic(aFlags, desc);
|
2013-12-03 16:20:04 -08:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
default: {
|
2013-12-11 17:44:47 -08:00
|
|
|
result = CreateBackendIndependentTextureHost(aDesc, aDeallocator, aFlags);
|
2013-12-03 16:20:04 -08:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace layers
|
|
|
|
} // namespace gfx
|