summaryrefslogtreecommitdiffstats
path: root/src/core/delegated_frame_node.cpp
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2017-04-11 09:50:38 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2017-06-14 12:41:31 +0000
commitdee6ffb0eb3b133d38f09a2f7dd915aee8c289e7 (patch)
tree5e0c1a9cb6d7cce41bc24b078eb9b7f8c5e4b745 /src/core/delegated_frame_node.cpp
parentd42caf438cf240c0ad1f803320f9063d6108a0aa (diff)
Graphics adaptations for Chromium 58
Change-Id: I66262ce7943bd5ba98defff5e4a33063b2ed0353 Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
Diffstat (limited to 'src/core/delegated_frame_node.cpp')
-rw-r--r--src/core/delegated_frame_node.cpp22
1 files changed, 5 insertions, 17 deletions
diff --git a/src/core/delegated_frame_node.cpp b/src/core/delegated_frame_node.cpp
index d3b7733a5..9a4d1ba91 100644
--- a/src/core/delegated_frame_node.cpp
+++ b/src/core/delegated_frame_node.cpp
@@ -1129,27 +1129,15 @@ void DelegatedFrameNode::fetchAndSyncMailboxes(QList<MailboxTexture *> &mailboxe
QMutexLocker lock(&m_mutex);
gpu::SyncPointManager *syncPointManager = sync_point_manager();
- if (!m_syncPointClient)
- m_syncPointClient = syncPointManager->CreateSyncPointClientWaiter();
base::MessageLoop *gpuMessageLoop = gpu_message_loop();
Q_ASSERT(m_numPendingSyncPoints == 0);
m_numPendingSyncPoints = mailboxesToFetch.count();
- auto it = mailboxesToFetch.constBegin();
- auto end = mailboxesToFetch.constEnd();
- for (; it != end; ++it) {
- MailboxTexture *mailboxTexture = *it;
+ for (MailboxTexture *mailboxTexture : qAsConst(mailboxesToFetch)) {
gpu::SyncToken &syncToken = mailboxTexture->mailboxHolder().sync_token;
- if (syncToken.HasData()) {
- scoped_refptr<gpu::SyncPointClientState> release_state =
- syncPointManager->GetSyncPointClientState(syncToken.namespace_id(), syncToken.command_buffer_id());
- if (release_state && !release_state->IsFenceSyncReleased(syncToken.release_count())) {
- m_syncPointClient->WaitOutOfOrderNonThreadSafe(
- release_state.get(), syncToken.release_count(),
- gpuMessageLoop->task_runner(), base::Bind(&DelegatedFrameNode::pullTexture, this, mailboxTexture));
- continue;
- }
- }
- gpuMessageLoop->task_runner()->PostTask(FROM_HERE, base::Bind(&DelegatedFrameNode::pullTexture, this, mailboxTexture));
+ const auto task = base::Bind(&DelegatedFrameNode::pullTexture, this, mailboxTexture);
+ if (syncPointManager->WaitOutOfOrderNonThreadSafe(syncToken, gpuMessageLoop->task_runner(), task))
+ continue;
+ gpuMessageLoop->task_runner()->PostTask(FROM_HERE, task);
}
m_mailboxesFetchedWaitCond.wait(&m_mutex);