summaryrefslogtreecommitdiffstats
path: root/gfx/angle/checkout/src/libANGLE/Semaphore.cpp
blob: a9f9114e8925465ccb49148e99db5aa7a1ba9080 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
//
// Copyright 2019 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// Semaphore.h: Implements the gl::Semaphore class [EXT_external_objects]

#include "libANGLE/Semaphore.h"

#include "common/angleutils.h"
#include "libANGLE/renderer/GLImplFactory.h"
#include "libANGLE/renderer/SemaphoreImpl.h"

namespace gl
{

Semaphore::Semaphore(rx::GLImplFactory *factory, GLuint id)
    : RefCountObject(id), mImplementation(factory->createSemaphore())
{}

Semaphore::~Semaphore() {}

void Semaphore::onDestroy(const Context *context)
{
    mImplementation->onDestroy(context);
}

angle::Result Semaphore::importFd(Context *context, HandleType handleType, GLint fd)
{
    return mImplementation->importFd(context, handleType, fd);
}

angle::Result Semaphore::wait(Context *context,
                              const BufferBarrierVector &bufferBarriers,
                              const TextureBarrierVector &textureBarriers)
{
    return mImplementation->wait(context, bufferBarriers, textureBarriers);
}

angle::Result Semaphore::signal(Context *context,
                                const BufferBarrierVector &bufferBarriers,
                                const TextureBarrierVector &textureBarriers)
{
    return mImplementation->signal(context, bufferBarriers, textureBarriers);
}

}  // namespace gl