Flutter Engine
The Flutter Engine
GrMtlBackendSemaphore.mm
Go to the documentation of this file.
1/*
2 * Copyright 2024 Google LLC
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
8
12
13#if !__has_feature(objc_arc)
14#error This file must be compiled with Arc. Use -fobjc-arc flag
15#endif
16
18public:
20
21 GrMTLHandle event() const { return fEvent; }
22 uint64_t value() const { return fValue; }
23
24private:
25 void copyTo(AnySemaphoreData& data) const override {
26 data.emplace<GrMtlBackendSemaphoreData>(fEvent, fValue);
27 }
28
29#if defined(SK_DEBUG)
30 GrBackendApi type() const override { return GrBackendApi::kMetal; }
31#endif
32
33 GrMTLHandle fEvent;
34 uint64_t fValue;
35};
36
39 SkASSERT(!data || data->type() == GrBackendApi::kMetal);
40 return static_cast<const GrMtlBackendSemaphoreData*>(data);
41}
42
43namespace GrBackendSemaphores {
47}
48
53 return data->event();
54}
55
56uint64_t GetMtlValue(const GrBackendSemaphore& sem) {
60 return data->value();
61}
62} // namespace GrBackendSemaphores
static const GrMtlBackendSemaphoreData * get_and_cast_data(const GrBackendSemaphore &sem)
const void * GrMTLHandle
Definition: GrMtlTypes.h:20
GrBackendApi
Definition: GrTypes.h:95
#define SkASSERT(cond)
Definition: SkAssert.h:116
GLenum type
GrBackendSemaphore::AnySemaphoreData AnySemaphoreData
static const GrBackendSemaphoreData * GetBackendData(const GrBackendSemaphore &sem)
static GrBackendSemaphore MakeGrBackendSemaphore(GrBackendApi backend, const SemaphoreData &data)
GrBackendApi backend() const
GrMtlBackendSemaphoreData(GrMTLHandle event, uint64_t value)
FlKeyEvent * event
uint8_t value
SK_API uint64_t GetMtlValue(const GrBackendSemaphore &)
SK_API GrMTLHandle GetMtlHandle(const GrBackendSemaphore &)
SK_API GrBackendSemaphore MakeMtl(GrMTLHandle event, uint64_t value)
std::shared_ptr< const fml::Mapping > data
Definition: texture_gles.cc:63