summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichal Klocek <michal.klocek@qt.io>2023-01-24 17:50:13 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2023-02-03 13:32:33 +0000
commit05be88df6947c79eb1e62f7565ffe4b0798f1b22 (patch)
treeddbb2508ba17981500f77dbe73aaa7a71c16c4f5
parent8de207408582812806881db824ec50cdf475f0cf (diff)
Move out GetInProcessGpuShareGroup form content browser client
Keeping the GetInProcessGpuShareGroup in content browser client creates dependency from gpu_child_thread to content browser, however gn build tree asserts when content/public/gpu depends on content/public/browser as it breaks intended components dependency. This worked so far as required headers in content browser client got generated on time despite of missing dependency. Fix the dependency tree and move the problematic function into the content gpu client. Change-Id: Iedcbc8c3c7d1754d1937e6b2c2a470c0e489a597 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> (cherry picked from commit 9739cc64c90e3852216f38fb15f04ba4477d0c39) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/core/compositor/content_gpu_client_qt.cpp9
-rw-r--r--src/core/compositor/content_gpu_client_qt.h9
-rw-r--r--src/core/content_browser_client_qt.cpp18
-rw-r--r--src/core/content_browser_client_qt.h7
4 files changed, 17 insertions, 26 deletions
diff --git a/src/core/compositor/content_gpu_client_qt.cpp b/src/core/compositor/content_gpu_client_qt.cpp
index 4c022dc7f..9f3b00bb8 100644
--- a/src/core/compositor/content_gpu_client_qt.cpp
+++ b/src/core/compositor/content_gpu_client_qt.cpp
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "content_gpu_client_qt.h"
-
+#include "ozone/gl_share_context_qt.h"
#include "web_engine_context.h"
namespace QtWebEngineCore {
@@ -20,4 +20,11 @@ gpu::SyncPointManager *ContentGpuClientQt::GetSyncPointManager()
return WebEngineContext::syncPointManager();
}
+gl::GLShareGroup *ContentGpuClientQt::GetInProcessGpuShareGroup()
+{
+ if (!m_shareGroupQt.get())
+ m_shareGroupQt = new ShareGroupQt;
+ return m_shareGroupQt.get();
+}
+
} // namespace
diff --git a/src/core/compositor/content_gpu_client_qt.h b/src/core/compositor/content_gpu_client_qt.h
index 75d9d68be..150c257ae 100644
--- a/src/core/compositor/content_gpu_client_qt.h
+++ b/src/core/compositor/content_gpu_client_qt.h
@@ -5,7 +5,12 @@
#include "content/public/gpu/content_gpu_client.h"
+namespace gl {
+class GLShareGroup;
+}
+
namespace QtWebEngineCore {
+class ShareGroupQt;
class ContentGpuClientQt : public content::ContentGpuClient {
public:
@@ -14,6 +19,10 @@ public:
// content::ContentGpuClient implementation.
gpu::SyncPointManager *GetSyncPointManager() override;
+ gl::GLShareGroup *GetInProcessGpuShareGroup() override;
+
+private:
+ scoped_refptr<ShareGroupQt> m_shareGroupQt;
};
}
diff --git a/src/core/content_browser_client_qt.cpp b/src/core/content_browser_client_qt.cpp
index f107b1a0f..f55e52eec 100644
--- a/src/core/content_browser_client_qt.cpp
+++ b/src/core/content_browser_client_qt.cpp
@@ -68,7 +68,6 @@
#include "net/proxying_restricted_cookie_manager_qt.h"
#include "net/proxying_url_loader_factory_qt.h"
#include "net/system_network_context_manager.h"
-#include "ozone/gl_share_context_qt.h"
#include "platform_notification_service_qt.h"
#include "profile_qt.h"
#include "profile_io_data_qt.h"
@@ -87,11 +86,6 @@
#include "api/qwebenginecookiestore_p.h"
#include "api/qwebengineurlrequestinfo_p.h"
-#if QT_CONFIG(opengl)
-#include <QOpenGLContext>
-#include <QOpenGLExtraFunctions>
-#endif
-
#if QT_CONFIG(webengine_geolocation)
#include "base/memory/ptr_util.h"
#include "location_provider_qt.h"
@@ -154,11 +148,6 @@
#include <QGuiApplication>
#include <QStandardPaths>
-#include <qpa/qplatformnativeinterface.h>
-
-QT_BEGIN_NAMESPACE
-Q_GUI_EXPORT QOpenGLContext *qt_gl_global_share_context();
-QT_END_NAMESPACE
// Implement IsHandledProtocol as declared in //url/url_util_qt.h.
namespace url {
@@ -248,13 +237,6 @@ void ContentBrowserClientQt::RenderProcessWillLaunch(content::RenderProcessHost
renderer_configuration->SetInitialConfiguration(is_incognito_process);
}
-gl::GLShareGroup *ContentBrowserClientQt::GetInProcessGpuShareGroup()
-{
- if (!m_shareGroupQt.get())
- m_shareGroupQt = new ShareGroupQt;
- return m_shareGroupQt.get();
-}
-
content::MediaObserver *ContentBrowserClientQt::GetMediaObserver()
{
return MediaCaptureDevicesDispatcher::GetInstance();
diff --git a/src/core/content_browser_client_qt.h b/src/core/content_browser_client_qt.h
index 4ee5c0228..ded346a34 100644
--- a/src/core/content_browser_client_qt.h
+++ b/src/core/content_browser_client_qt.h
@@ -28,14 +28,9 @@ namespace device {
class GeolocationManager;
} // namespace device
-namespace gl {
-class GLShareGroup;
-}
-
namespace QtWebEngineCore {
class BrowserMainPartsQt;
-class ShareGroupQt;
class ContentBrowserClientQt : public content::ContentBrowserClient
{
@@ -44,7 +39,6 @@ public:
~ContentBrowserClientQt();
std::unique_ptr<content::BrowserMainParts> CreateBrowserMainParts(content::MainFunctionParams) override;
void RenderProcessWillLaunch(content::RenderProcessHost *host) override;
- gl::GLShareGroup* GetInProcessGpuShareGroup() override;
content::MediaObserver* GetMediaObserver() override;
scoped_refptr<content::QuotaPermissionContext> CreateQuotaPermissionContext() override;
void OverrideWebkitPrefs(content::WebContents *web_contents,
@@ -240,7 +234,6 @@ public:
std::string GetProduct() override;
private:
- scoped_refptr<ShareGroupQt> m_shareGroupQt;
BrowserMainPartsQt *m_browserMainParts = nullptr;
};