Source code

Revision control

Other Tools

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 "SyncObject.h"
8
9
#ifdef XP_WIN
10
# include "mozilla/layers/TextureD3D11.h"
11
#endif
12
13
namespace mozilla {
14
namespace layers {
15
16
already_AddRefed<SyncObjectHost> SyncObjectHost::CreateSyncObjectHost(
17
#ifdef XP_WIN
18
ID3D11Device* aDevice
19
#endif
20
) {
21
#ifdef XP_WIN
22
return MakeAndAddRef<SyncObjectD3D11Host>(aDevice);
23
#else
24
return nullptr;
25
#endif
26
}
27
28
already_AddRefed<SyncObjectClient> SyncObjectClient::CreateSyncObjectClient(
29
SyncHandle aHandle
30
#ifdef XP_WIN
31
,
32
ID3D11Device* aDevice
33
#endif
34
) {
35
if (!aHandle) {
36
return nullptr;
37
}
38
39
#ifdef XP_WIN
40
return MakeAndAddRef<SyncObjectD3D11Client>(aHandle, aDevice);
41
#else
42
MOZ_ASSERT_UNREACHABLE("CreateSyncObjectClient only supports Windows");
43
return nullptr;
44
#endif
45
}
46
47
} // namespace layers
48
} // namespace mozilla