Flutter Engine Uber Docs
Docs for the entire Flutter Engine repo.
 
Loading...
Searching...
No Matches
gpu_submission_tracker.cc
Go to the documentation of this file.
1// Copyright 2013 The Flutter Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
6
7#include <algorithm>
8
9namespace impeller {
10
12 Lock lock(mutex_);
13 uint64_t id = ++last_id_;
14 pending_.push_back(id);
15 return id;
16}
17
19 Lock lock(mutex_);
20 auto it = std::lower_bound(pending_.begin(), pending_.end(), id);
21 if (it != pending_.end() && *it == id) {
22 pending_.erase(it);
23 }
24}
25
27 Lock lock(mutex_);
28 if (pending_.empty()) {
29 return last_id_;
30 }
31 return pending_.front() - 1;
32}
33
35 Lock lock(mutex_);
36 return last_id_;
37}
38
39} // namespace impeller
uint64_t LatestSubmission() const
Returns the id of the most recent submission.
void RecordCompletion(uint64_t id)
Marks a previously recorded submission as completed by the GPU.
uint64_t RecordSubmission()
Records a command buffer submission and returns its id.
const uintptr_t id