Hash :
5313c8a8
Author :
Date :
2019-01-14T17:02:52
Implement EGL_KHR_fence_sync and EGL_KHR_wait_sync EGL_KHR_fence_sync introduces the EGLSync object and associated create/destroy/clientWait functions. EGL_KHR_wait_sync adds the serverWait function on top of that. Bug: angleproject:2466 Change-Id: Iebb239a85c4471ea18b3c3a8a83b793af555e31d Reviewed-on: https://chromium-review.googlesource.com/c/1412261 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>
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 48 49 50 51 52 53
//
// Copyright (c) 2002-2013 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.
//
// EGLSync.cpp: Implements the egl::Sync class.
#include "libANGLE/EGLSync.h"
#include "angle_gl.h"
#include "common/utilities.h"
#include "libANGLE/renderer/EGLImplFactory.h"
#include "libANGLE/renderer/EGLSyncImpl.h"
namespace egl
{
Sync::Sync(rx::EGLImplFactory *factory, EGLenum type, const AttributeMap &attribs)
: mFence(factory->createSync(attribs)), mType(type)
{}
void Sync::onDestroy(const Display *display)
{
ASSERT(mFence);
mFence->onDestroy(display);
mFence.reset();
}
Sync::~Sync() {}
Error Sync::initialize(const Display *display)
{
return mFence->initialize(display, mType);
}
Error Sync::clientWait(const Display *display, EGLint flags, EGLTime timeout, EGLint *outResult)
{
return mFence->clientWait(display, flags, timeout, outResult);
}
Error Sync::serverWait(const Display *display, EGLint flags)
{
return mFence->serverWait(display, flags);
}
Error Sync::getStatus(const Display *display, EGLint *outStatus) const
{
return mFence->getStatus(display, outStatus);
}
} // namespace egl