/* * Copyright 2019 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #ifndef GrMtlSemaphore_DEFINED #define GrMtlSemaphore_DEFINED #include "include/gpu/GrBackendSemaphore.h" #include "include/private/GrTypesPriv.h" #include "src/gpu/GrSemaphore.h" #include "src/gpu/mtl/GrMtlUtil.h" #include class GrMtlGpu; class GrMtlSemaphore : public GrSemaphore { public: static std::unique_ptr Make(GrMtlGpu* gpu); static std::unique_ptr MakeWrapped(GrMTLHandle event, uint64_t value); ~GrMtlSemaphore() override {} id event() const SK_API_AVAILABLE(macos(10.14), ios(12.0)) { return fEvent; } uint64_t value() const { return fValue; } GrBackendSemaphore backendSemaphore() const override; private: GrMtlSemaphore(id event, uint64_t value) SK_API_AVAILABLE(macos(10.14), ios(12.0)); void setIsOwned() override {} id fEvent SK_API_AVAILABLE(macos(10.14), ios(12.0)); uint64_t fValue; using INHERITED = GrSemaphore; }; #endif