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
#ifndef MOZILLA_LAYERS_TEXTURESYNC_H
8
#define MOZILLA_LAYERS_TEXTURESYNC_H
9
10
#include "base/process.h"
11
12
#include "nsTArray.h"
13
#include "mozilla/layers/TextureSourceProvider.h"
14
15
#include "SharedMemory.h"
16
17
class MachReceiveMessage;
18
19
namespace mozilla {
20
namespace ipc {
21
struct MemoryPorts;
22
} // namespace ipc
23
24
namespace layers {
25
26
class TextureSync {
27
public:
28
static void RegisterTextureSourceProvider(
29
layers::TextureSourceProvider* aTextureSourceProvider);
30
static void UnregisterTextureSourceProvider(
31
layers::TextureSourceProvider* aTextureSourceProvider);
32
static void DispatchCheckTexturesForUnlock();
33
static void HandleWaitForTexturesMessage(MachReceiveMessage* rmsg,
34
ipc::MemoryPorts* ports);
35
static void UpdateTextureLocks(base::ProcessId aProcessId);
36
static bool WaitForTextures(base::ProcessId aProcessId,
37
const nsTArray<uint64_t>& aTextureIds);
38
static void SetTexturesLocked(base::ProcessId aProcessId,
39
const nsTArray<uint64_t>& aTextureIds);
40
static void SetTexturesUnlocked(base::ProcessId aProcessId,
41
const nsTArray<uint64_t>& aTextureIds);
42
static void Shutdown();
43
static void CleanupForPid(base::ProcessId aProcessId);
44
};
45
46
} // namespace layers
47
} // namespace mozilla
48
49
#endif