Commit 5655b815 authored by Jocelyn Turcotte's avatar Jocelyn Turcotte Committed by The Qt Project
Browse files

Remove the native window hardware acceleration support for widgets.


This experiment served its purpose and is now more often broken
than useful.

Change-Id: I73ea68c99dedcc8a3fe9004d130518daf146b493
Reviewed-by: default avatarZeno Albisser <zeno.albisser@digia.com>
Showing with 7 additions and 24 deletions
......@@ -74,8 +74,7 @@ class QWEBENGINE_EXPORT WebContentsAdapterClient {
public:
enum CompositingMode {
NoCompositing,
DelegatedCompositing,
ForcedGpuProcessCompositing
DelegatedCompositing
};
// This must match window_open_disposition_list.h.
......
......@@ -76,8 +76,6 @@ content::RenderWidgetHostView* WebContentsViewQt::CreateViewForPopupWidget(conte
WebContentsAdapterClient::CompositingMode compositingMode = WebContentsAdapterClient::NoCompositing;
if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableDelegatedRenderer))
compositingMode = WebContentsAdapterClient::DelegatedCompositing;
else if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kForceCompositingMode))
compositingMode = WebContentsAdapterClient::ForcedGpuProcessCompositing;
Q_ASSERT(m_factoryClient);
view->setDelegate(m_factoryClient->CreateRenderWidgetHostViewQtDelegate(view, compositingMode));
......
......@@ -60,7 +60,8 @@ QWebEnginePagePrivate::~QWebEnginePagePrivate()
RenderWidgetHostViewQtDelegate *QWebEnginePagePrivate::CreateRenderWidgetHostViewQtDelegate(RenderWidgetHostViewQtDelegateClient *client, CompositingMode mode)
{
return new RenderWidgetHostViewQtDelegateWidget(client, mode);
Q_UNUSED(mode);
return new RenderWidgetHostViewQtDelegateWidget(client);
}
void QWebEnginePagePrivate::titleChanged(const QString &title)
......
......@@ -51,7 +51,7 @@
#include <QWindow>
#include <QtWidgets/QApplication>
RenderWidgetHostViewQtDelegateWidget::RenderWidgetHostViewQtDelegateWidget(RenderWidgetHostViewQtDelegateClient *client, WebContentsAdapterClient::CompositingMode mode, QWidget *parent)
RenderWidgetHostViewQtDelegateWidget::RenderWidgetHostViewQtDelegateWidget(RenderWidgetHostViewQtDelegateClient *client, QWidget *parent)
: QWidget(parent)
, m_client(client)
{
......@@ -59,21 +59,6 @@ RenderWidgetHostViewQtDelegateWidget::RenderWidgetHostViewQtDelegateWidget(Rende
setMouseTracking(true);
setAttribute(Qt::WA_AcceptTouchEvents);
setAttribute(Qt::WA_OpaquePaintEvent);
#if defined(Q_OS_LINUX)
// FOR TESTING ONLY, use at your own risks.
// Supporting this properly on all platforms would require duplicating
// many tricks done by RenderWidgetHostView[Win|Mac].
if (mode == WebContentsAdapterClient::ForcedGpuProcessCompositing) {
// This sets Qt::WA_NativeWindow and force a native window creation
// that we can give to the GPU process for it to render directly
// on through windowHandle().
winId();
// This makes sure that we won't try to paint the regular backing store
// on the window at the same time as the compositor.
setUpdatesEnabled(false);
}
#endif
}
void RenderWidgetHostViewQtDelegateWidget::initAsChild(WebContentsAdapterClient* container)
......@@ -124,8 +109,8 @@ bool RenderWidgetHostViewQtDelegateWidget::isVisible() const
WId RenderWidgetHostViewQtDelegateWidget::nativeWindowIdForCompositor() const
{
QWindow* window = QWidget::windowHandle();
return window ? window->winId() : 0;
// The QtWidgets API doesn't support hardware acceleration.
return 0;
}
QWindow* RenderWidgetHostViewQtDelegateWidget::window() const
......
......@@ -56,7 +56,7 @@ QT_END_NAMESPACE
class RenderWidgetHostViewQtDelegateWidget : public QWidget, public RenderWidgetHostViewQtDelegate
{
public:
RenderWidgetHostViewQtDelegateWidget(RenderWidgetHostViewQtDelegateClient *client, WebContentsAdapterClient::CompositingMode mode, QWidget *parent = 0);
RenderWidgetHostViewQtDelegateWidget(RenderWidgetHostViewQtDelegateClient *client, QWidget *parent = 0);
virtual void initAsChild(WebContentsAdapterClient* container);
virtual void initAsPopup(const QRect&);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment