From 56714be7d05afb94c63b658a4fdb2bedd1bee645 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Tue, 26 Jan 2016 10:51:22 +0100 Subject: Update GL mailbox synchronization to Chromium 49 Chromium 49 switched to using SyncToken, making our old model based on sync-points obsolete. This patch rewrites our syncing to instead take advantage of new Chromium API for waiting on sync tokens. It also moves the creation of the GLFences we use out of Chromium. Task-number: QTBUG-51173 Change-Id: I04d726d4bc81bf6b7fe39bb2b5507e84a0b6991e Reviewed-by: Joerg Bornemann --- src/core/delegated_frame_node.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/core/delegated_frame_node.h') diff --git a/src/core/delegated_frame_node.h b/src/core/delegated_frame_node.h index 9c05cb872..8a37f6b4c 100644 --- a/src/core/delegated_frame_node.h +++ b/src/core/delegated_frame_node.h @@ -43,6 +43,8 @@ #include "base/memory/scoped_ptr.h" #include "cc/quads/render_pass.h" #include "cc/resources/transferable_resource.h" +#include "gpu/command_buffer/service/sync_point_manager.h" +#include "ui/gl/gl_fence.h" #include #include #include @@ -83,10 +85,11 @@ public: void commit(ChromiumCompositorData *chromiumCompositorData, cc::ReturnedResourceArray *resourcesToRelease, RenderWidgetHostViewQtDelegate *apiDelegate); private: + void fetchAndSyncMailboxes(QList &mailboxesToFetch); // Making those callbacks static bypasses base::Bind's ref-counting requirement // of the this pointer when the callback is a method. - static void fetchTexturesAndUnlockQt(DelegatedFrameNode *frameNode, QList *mailboxesToFetch); - static void syncPointRetired(DelegatedFrameNode *frameNode, QList *mailboxesToFetch); + static void pullTexture(DelegatedFrameNode *frameNode, MailboxTexture *mailbox); + static void fenceAndUnlockQt(DelegatedFrameNode *frameNode); ResourceHolder *findAndHoldResource(unsigned resourceId, QHash > &candidates); QSGTexture *initAndHoldTexture(ResourceHolder *resource, bool quadIsAllOpaque, RenderWidgetHostViewQtDelegate *apiDelegate = 0); @@ -98,9 +101,10 @@ private: QVector > textureStrongRefs; } m_sgObjects; int m_numPendingSyncPoints; - QMap m_mailboxGLFences; QWaitCondition m_mailboxesFetchedWaitCond; QMutex m_mutex; + QList m_textureFences; + scoped_ptr m_syncPointClient; }; } // namespace QtWebEngineCore -- cgit v1.2.3