Edit

kc3-lang/angle/src/libANGLE/EGLSync.cpp

Branch :

  • Show log

    Commit

  • Author : Shahbaz Youssefi
    Date : 2019-01-14 17:02:52
    Hash : 5313c8a8
    Message : 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>

  • src/libANGLE/EGLSync.cpp
  • //
    // 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