Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
DawnAsyncWait.cpp
Go to the documentation of this file.
1/*
2 * Copyright 2022 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 */
7
9
13
14namespace skgpu::graphite {
15
17 : fSharedContext(sharedContext)
18 , fSignaled(false) {}
19
21 if (fSharedContext->hasTick()) {
22 if (fSignaled.load(std::memory_order_acquire)) {
23 return true;
24 }
25
26 fSharedContext->tick();
27 }
28 return fSignaled.load(std::memory_order_acquire);
29}
30
31bool DawnAsyncWait::mayBusyWait() const { return fSharedContext->caps()->allowCpuSync(); }
32
34 SkASSERT(fSharedContext->hasTick());
35 while (!this->yieldAndCheck()) {}
36}
37
38} // namespace skgpu::graphite
#define SkASSERT(cond)
Definition SkAssert.h:116
bool allowCpuSync() const
Definition Caps.h:225
DawnAsyncWait(const DawnSharedContext *)
const Caps * caps() const