diff options
26 files changed, 52 insertions, 462 deletions
diff --git a/src/core/backing_store_qt.cpp b/src/core/backing_store_qt.cpp deleted file mode 100644 index 613dfdbbc..000000000 --- a/src/core/backing_store_qt.cpp +++ /dev/null @@ -1,187 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the QtWebEngine module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "backing_store_qt.h" - -#include "type_conversion.h" - -#include "content/public/browser/render_process_host.h" -#include "ui/gfx/rect.h" -#include "ui/gfx/rect_conversions.h" -#include "ui/gfx/vector2d_conversions.h" -#include "skia/ext/platform_canvas.h" - -#include <QPainter> -#include <QScreen> -#include <QSizeF> -#include <QWindow> - -QT_BEGIN_NAMESPACE -// from qbackingstore.cpp -extern void qt_scrollRectInImage(QImage &img, const QRect &rect, const QPoint &offset); -QT_END_NAMESPACE - -BackingStoreQt::BackingStoreQt(content::RenderWidgetHost *host, const gfx::Size &size, QWindow* parent) - : content::BackingStore(host, size) - , m_deviceScaleFactor((parent && parent->screen()) ? parent->screen()->devicePixelRatio() : 1) - , m_pixelBuffer(size.width() * m_deviceScaleFactor, size.height() * m_deviceScaleFactor, QImage::Format_ARGB32_Premultiplied) -{ -} - -BackingStoreQt::~BackingStoreQt() -{ -} - -void BackingStoreQt::paintToTarget(QPainter* painter, const QRectF& rect) -{ - if (m_pixelBuffer.isNull()) - return; - - qreal x = rect.x() * m_deviceScaleFactor; - qreal y = rect.y() * m_deviceScaleFactor; - qreal w = rect.width() * m_deviceScaleFactor; - qreal h = rect.height() * m_deviceScaleFactor; - - QRectF source(x, y, w, h); - painter->drawImage(rect, m_pixelBuffer, source); -} - -void BackingStoreQt::PaintToBackingStore(content::RenderProcessHost *process, - TransportDIB::Id bitmap, - const gfx::Rect &bitmap_rect, - const std::vector<gfx::Rect> ©_rects, - float scale_factor, - const base::Closure &completion_callback, - bool *scheduled_completion_callback) -{ - if (bitmap_rect.IsEmpty()) - return; - - *scheduled_completion_callback = false; - TransportDIB* dib = process->GetTransportDIB(bitmap); - if (!dib) - return; - - gfx::Rect pixel_bitmap_rect = gfx::ToEnclosingRect(gfx::ScaleRect(bitmap_rect, scale_factor)); - - uint8_t* bitmapData = static_cast<uint8_t*>(dib->memory()); - const QImage img(bitmapData, pixel_bitmap_rect.width(), pixel_bitmap_rect.height(), QImage::Format_ARGB32); - - QPainter painter(&m_pixelBuffer); - for (size_t i = 0; i < copy_rects.size(); ++i) { - gfx::Rect copy_rect = gfx::ToEnclosingRect(gfx::ScaleRect(copy_rects[i], scale_factor)); - - QRect source = QRect( copy_rect.x() - pixel_bitmap_rect.x() - , copy_rect.y() - pixel_bitmap_rect.y() - , copy_rect.width() - , copy_rect.height()); - - gfx::Rect copy_rect_dst = gfx::ToEnclosingRect(gfx::ScaleRect(copy_rects[i], m_deviceScaleFactor)); - - QRect destination = QRect( copy_rect_dst.x() - , copy_rect_dst.y() - , copy_rect_dst.width() - , copy_rect_dst.height()); - -#if defined(OS_ANDROID) - // The received image format is BGRA with Android so we have to swizzle the image data. - painter.drawImage(destination, img.rgbSwapped(), source); -#else - painter.drawImage(destination, img, source); -#endif - } -} - -void BackingStoreQt::ScrollBackingStore(const gfx::Vector2d &delta, const gfx::Rect &clip_rect, const gfx::Size &view_size) -{ - DCHECK(delta.x() == 0 || delta.y() == 0); - - gfx::Rect pixel_rect = gfx::ToEnclosingRect(gfx::ScaleRect(clip_rect, m_deviceScaleFactor)); - gfx::Vector2d pixel_delta = gfx::ToFlooredVector2d(gfx::ScaleVector2d(delta, m_deviceScaleFactor)); - - // Logic borrowed from QPixmap::scroll and QRasterPlatformPixmap::scroll. - QRect dest = toQt(pixel_rect) & m_pixelBuffer.rect(); - QRect src = dest.translated(-pixel_delta.x(), -pixel_delta.y()) & dest; - qt_scrollRectInImage(m_pixelBuffer, src, QPoint(pixel_delta.x(), pixel_delta.y())); -} - -bool BackingStoreQt::CopyFromBackingStore(const gfx::Rect &rect, skia::PlatformBitmap *output) -{ - const int width = std::min(m_pixelBuffer.width(), rect.width()); - const int height = std::min(m_pixelBuffer.height(), rect.height()); - - if (!output->Allocate(width, height, true)) - return false; - - // This code assumes a visual mode where a pixel is - // represented using a 32-bit unsigned int, with a byte per component. - const SkBitmap& bitmap = output->GetBitmap(); - if (bitmap.rowBytes() != 4) - return false; - - SkAutoLockPixels alp(bitmap); - - QImage cpy = m_pixelBuffer.copy(rect.x(), rect.y(), rect.width(), rect.height()); - - // Convert the format and remove transparency. - if (cpy.format() != QImage::Format_RGB32) - cpy = cpy.convertToFormat(QImage::Format_RGB32); - - const uint8_t* src = cpy.bits(); - uint8_t* dst = reinterpret_cast<uint8_t*>(bitmap.getAddr32(0,0)); - - int bytesPerLine = cpy.bytesPerLine(); - int bytesPerPixel = bytesPerLine / cpy.width(); - int copyLineLength = width * bytesPerPixel; - int lineOffset = rect.y() * cpy.width(); - int rowOffset = rect.x() * bytesPerPixel; - - const uint8_t* copyLineBegin = src + rowOffset + lineOffset; - - for (int lineNumber = 0; lineNumber < height; ++lineNumber) { - memcpy(dst, copyLineBegin, copyLineLength); - dst += copyLineLength; - copyLineBegin += cpy.width(); - } - - return true; -} - diff --git a/src/core/backing_store_qt.h b/src/core/backing_store_qt.h deleted file mode 100644 index 24f232a02..000000000 --- a/src/core/backing_store_qt.h +++ /dev/null @@ -1,72 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the QtWebEngine module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef BACKING_STORE_QT_H -#define BACKING_STORE_QT_H - -#include "content/browser/renderer_host/backing_store.h" - -#include <QPainter> -#include <QImage> - -class BackingStoreQt : public content::BackingStore -{ -public: - BackingStoreQt(content::RenderWidgetHost *host, const gfx::Size &size, QWindow* parent); - ~BackingStoreQt(); - - void paintToTarget(QPainter*, const QRectF& rect); - - virtual void PaintToBackingStore(content::RenderProcessHost *process, TransportDIB::Id bitmap, const gfx::Rect &bitmap_rect, - const std::vector<gfx::Rect> ©_rects, float scale_factor, const base::Closure &completion_callback, - bool *scheduled_completion_callback) Q_DECL_OVERRIDE; - - virtual void ScrollBackingStore(const gfx::Vector2d &delta, const gfx::Rect &clip_rect, const gfx::Size &view_size) Q_DECL_OVERRIDE; - virtual bool CopyFromBackingStore(const gfx::Rect &rect, skia::PlatformBitmap *output) Q_DECL_OVERRIDE; - -private: - // Number of physical pixels per view unit. This is 1 or 2 in practice. - float m_deviceScaleFactor; - - QImage m_pixelBuffer; -}; - -#endif // BACKING_STORE_QT_H diff --git a/src/core/core_gyp_generator.pro b/src/core/core_gyp_generator.pro index 8b90bc91c..f6b513a21 100644 --- a/src/core/core_gyp_generator.pro +++ b/src/core/core_gyp_generator.pro @@ -28,7 +28,6 @@ RESOURCES += devtools.qrc INCLUDEPATH += $$[QT_INSTALL_HEADERS] $$PWD SOURCES = \ - backing_store_qt.cpp \ browser_context_qt.cpp \ chromium_gpu_helper.cpp \ chromium_overrides.cpp \ @@ -67,7 +66,6 @@ SOURCES = \ HEADERS = \ - backing_store_qt.h \ browser_context_qt.h \ chromium_overrides.h \ clipboard_qt.h \ diff --git a/src/core/render_widget_host_view_qt.cpp b/src/core/render_widget_host_view_qt.cpp index 7df9ee46a..7d470e5cf 100644 --- a/src/core/render_widget_host_view_qt.cpp +++ b/src/core/render_widget_host_view_qt.cpp @@ -41,7 +41,6 @@ #include "render_widget_host_view_qt.h" -#include "backing_store_qt.h" #include "chromium_overrides.h" #include "delegated_frame_node.h" #include "render_widget_host_view_qt_delegate.h" @@ -163,7 +162,6 @@ static bool shouldSendPinchGesture() RenderWidgetHostViewQt::RenderWidgetHostViewQt(content::RenderWidgetHost* widget) : m_host(content::RenderWidgetHostImpl::From(widget)) , m_gestureRecognizer(ui::GestureRecognizer::Create()) - , m_backingStore(0) , m_frameNodeData(new DelegatedFrameNodeData) , m_needsDelegatedFrameAck(false) , m_adapterClient(0) @@ -194,16 +192,9 @@ void RenderWidgetHostViewQt::setAdapterClient(WebContentsAdapterClient *adapterC InitAsChild(0); } -BackingStoreQt* RenderWidgetHostViewQt::GetBackingStore() -{ - bool force_create = !m_host->empty(); - return static_cast<BackingStoreQt*>(m_host->GetBackingStore(force_create)); -} - content::BackingStore *RenderWidgetHostViewQt::AllocBackingStore(const gfx::Size &size) { - Q_ASSERT(m_delegate); - return new BackingStoreQt(m_host, size, m_delegate->window()); + Q_UNREACHABLE(); } void RenderWidgetHostViewQt::InitAsChild(gfx::NativeView) @@ -628,8 +619,6 @@ gfx::Rect RenderWidgetHostViewQt::GetBoundsInRootWindow() gfx::GLSurfaceHandle RenderWidgetHostViewQt::GetCompositingSurface() { - if (!m_delegate->supportsHardwareAcceleration()) - return gfx::GLSurfaceHandle(); return gfx::GLSurfaceHandle(gfx::kNullPluginWindow, gfx::TEXTURE_TRANSPORT); } @@ -679,12 +668,6 @@ void RenderWidgetHostViewQt::DispatchCancelTouchEvent(ui::TouchEvent *event) m_host->ForwardTouchEventWithLatencyInfo(cancelEvent, *event->latency()); } -void RenderWidgetHostViewQt::paint(QPainter *painter, const QRectF& boundingRect) -{ - if (m_backingStore) - m_backingStore->paintToTarget(painter, boundingRect); -} - QSGNode *RenderWidgetHostViewQt::updatePaintNode(QSGNode *oldNode, QSGRenderContext *sgRenderContext) { DelegatedFrameNode *frameNode = static_cast<DelegatedFrameNode *>(oldNode); @@ -704,11 +687,6 @@ QSGNode *RenderWidgetHostViewQt::updatePaintNode(QSGNode *oldNode, QSGRenderCont return frameNode; } -void RenderWidgetHostViewQt::fetchBackingStore() -{ - m_backingStore = GetBackingStore(); -} - void RenderWidgetHostViewQt::notifyResize() { GetRenderWidgetHost()->WasResized(); @@ -812,8 +790,7 @@ void RenderWidgetHostViewQt::sendDelegatedFrameAck() void RenderWidgetHostViewQt::Paint(const gfx::Rect& damage_rect) { - QRect r(damage_rect.x(), damage_rect.y(), damage_rect.width(), damage_rect.height()); - m_delegate->update(r); + Q_UNREACHABLE(); } void RenderWidgetHostViewQt::ForwardGestureEventToRenderer(ui::GestureEvent* gesture) diff --git a/src/core/render_widget_host_view_qt.h b/src/core/render_widget_host_view_qt.h index 208336b8b..f91beb6d2 100644 --- a/src/core/render_widget_host_view_qt.h +++ b/src/core/render_widget_host_view_qt.h @@ -56,8 +56,6 @@ #include <QRect> #include <QtGlobal> -class BackingStoreQt; - QT_BEGIN_NAMESPACE class QEvent; class QFocusEvent; @@ -100,7 +98,6 @@ public: void setDelegate(RenderWidgetHostViewQtDelegate *delegate); void setAdapterClient(WebContentsAdapterClient *adapterClient); - BackingStoreQt* GetBackingStore(); virtual content::BackingStore *AllocBackingStore(const gfx::Size &size) Q_DECL_OVERRIDE; @@ -167,9 +164,7 @@ public: virtual void DispatchCancelTouchEvent(ui::TouchEvent*) Q_DECL_OVERRIDE; // Overridden from RenderWidgetHostViewQtDelegateClient. - virtual void paint(QPainter *, const QRectF& boundingRect) Q_DECL_OVERRIDE; virtual QSGNode *updatePaintNode(QSGNode *, QSGRenderContext *) Q_DECL_OVERRIDE; - virtual void fetchBackingStore() Q_DECL_OVERRIDE; virtual void notifyResize() Q_DECL_OVERRIDE; virtual bool forwardEvent(QEvent *) Q_DECL_OVERRIDE; virtual QVariant inputMethodQuery(Qt::InputMethodQuery query) const Q_DECL_OVERRIDE; @@ -229,7 +224,6 @@ private: blink::WebTouchEvent m_accumTouchEvent; scoped_ptr<RenderWidgetHostViewQtDelegate> m_delegate; - BackingStoreQt *m_backingStore; QExplicitlySharedDataPointer<DelegatedFrameNodeData> m_frameNodeData; cc::ReturnedResourceArray m_resourcesToRelease; bool m_needsDelegatedFrameAck; diff --git a/src/core/render_widget_host_view_qt_delegate.h b/src/core/render_widget_host_view_qt_delegate.h index ddfa2b3c8..a8515e0e3 100644 --- a/src/core/render_widget_host_view_qt_delegate.h +++ b/src/core/render_widget_host_view_qt_delegate.h @@ -63,9 +63,7 @@ class WebContentsAdapterClient; class QWEBENGINE_EXPORT RenderWidgetHostViewQtDelegateClient { public: virtual ~RenderWidgetHostViewQtDelegateClient() { } - virtual void paint(QPainter *, const QRectF& boundingRect) = 0; virtual QSGNode *updatePaintNode(QSGNode *, QSGRenderContext *) = 0; - virtual void fetchBackingStore() = 0; virtual void notifyResize() = 0; virtual bool forwardEvent(QEvent *) = 0; virtual QVariant inputMethodQuery(Qt::InputMethodQuery query) const = 0; @@ -84,12 +82,11 @@ public: virtual void hide() = 0; virtual bool isVisible() const = 0; virtual QWindow* window() const = 0; - virtual void update(const QRect& rect = QRect()) = 0; + virtual void update() = 0; virtual void updateCursor(const QCursor &) = 0; virtual void resize(int width, int height) = 0; virtual void move(const QPoint &) = 0; virtual void inputMethodStateChanged(bool editorVisible) = 0; - virtual bool supportsHardwareAcceleration() const = 0; virtual void setTooltip(const QString &) = 0; }; diff --git a/src/core/web_contents_adapter.cpp b/src/core/web_contents_adapter.cpp index 6c3b68b6a..ff0b9a83d 100644 --- a/src/core/web_contents_adapter.cpp +++ b/src/core/web_contents_adapter.cpp @@ -292,7 +292,7 @@ void deserializeNavigationHistory(QDataStream &input, int *currentIndex, std::ve class WebContentsAdapterPrivate { public: - WebContentsAdapterPrivate(WebContentsAdapterClient::RenderingMode renderingMode); + WebContentsAdapterPrivate(); scoped_refptr<WebEngineContext> engineContext; scoped_ptr<content::WebContents> webContents; scoped_ptr<WebContentsDelegateQt> webContentsDelegate; @@ -302,14 +302,14 @@ public: QString lastSearchedString; }; -WebContentsAdapterPrivate::WebContentsAdapterPrivate(WebContentsAdapterClient::RenderingMode renderingMode) +WebContentsAdapterPrivate::WebContentsAdapterPrivate() // This has to be the first thing we create, and the last we destroy. - : engineContext(WebEngineContext::currentOrCreate(renderingMode)) + : engineContext(WebEngineContext::current()) , lastRequestId(0) { } -QExplicitlySharedDataPointer<WebContentsAdapter> WebContentsAdapter::createFromSerializedNavigationHistory(QDataStream &input, WebContentsAdapterClient *adapterClient, WebContentsAdapterClient::RenderingMode renderingMode) +QExplicitlySharedDataPointer<WebContentsAdapter> WebContentsAdapter::createFromSerializedNavigationHistory(QDataStream &input, WebContentsAdapterClient *adapterClient) { int currentIndex; std::vector<content::NavigationEntry*> entries; @@ -334,11 +334,11 @@ QExplicitlySharedDataPointer<WebContentsAdapter> WebContentsAdapter::createFromS content::ChildProcessSecurityPolicy::GetInstance()->GrantReadFile(id, *file); } - return QExplicitlySharedDataPointer<WebContentsAdapter>(new WebContentsAdapter(renderingMode, newWebContents)); + return QExplicitlySharedDataPointer<WebContentsAdapter>(new WebContentsAdapter(newWebContents)); } -WebContentsAdapter::WebContentsAdapter(WebContentsAdapterClient::RenderingMode renderingMode, content::WebContents *webContents) - : d_ptr(new WebContentsAdapterPrivate(renderingMode)) +WebContentsAdapter::WebContentsAdapter(content::WebContents *webContents) + : d_ptr(new WebContentsAdapterPrivate) { Q_D(WebContentsAdapter); d->webContents.reset(webContents); diff --git a/src/core/web_contents_adapter.h b/src/core/web_contents_adapter.h index 6e274f4e3..fc6ea99fb 100644 --- a/src/core/web_contents_adapter.h +++ b/src/core/web_contents_adapter.h @@ -56,9 +56,9 @@ class WebContentsAdapterPrivate; class QWEBENGINE_EXPORT WebContentsAdapter : public QSharedData { public: - static QExplicitlySharedDataPointer<WebContentsAdapter> createFromSerializedNavigationHistory(QDataStream &input, WebContentsAdapterClient *adapterClient, WebContentsAdapterClient::RenderingMode renderingMode); + static QExplicitlySharedDataPointer<WebContentsAdapter> createFromSerializedNavigationHistory(QDataStream &input, WebContentsAdapterClient *adapterClient); // Takes ownership of the WebContents. - WebContentsAdapter(WebContentsAdapterClient::RenderingMode renderingMode, content::WebContents *webContents = 0); + WebContentsAdapter(content::WebContents *webContents = 0); ~WebContentsAdapter(); void initialize(WebContentsAdapterClient *adapterClient); void reattachRWHV(); diff --git a/src/core/web_contents_adapter_client.h b/src/core/web_contents_adapter_client.h index 3a9d9dd93..2c89de369 100644 --- a/src/core/web_contents_adapter_client.h +++ b/src/core/web_contents_adapter_client.h @@ -77,11 +77,6 @@ public: class QWEBENGINE_EXPORT WebContentsAdapterClient { public: - enum RenderingMode { - SoftwareRenderingMode, - HardwareAccelerationMode - }; - // This must match window_open_disposition_list.h. enum WindowOpenDisposition { UnknownDisposition = 0, @@ -114,8 +109,8 @@ public: virtual ~WebContentsAdapterClient() { } - virtual RenderWidgetHostViewQtDelegate* CreateRenderWidgetHostViewQtDelegate(RenderWidgetHostViewQtDelegateClient *client, RenderingMode mode) = 0; - virtual RenderWidgetHostViewQtDelegate* CreateRenderWidgetHostViewQtDelegateForPopup(RenderWidgetHostViewQtDelegateClient *client, RenderingMode mode) = 0; + virtual RenderWidgetHostViewQtDelegate* CreateRenderWidgetHostViewQtDelegate(RenderWidgetHostViewQtDelegateClient *client) = 0; + virtual RenderWidgetHostViewQtDelegate* CreateRenderWidgetHostViewQtDelegateForPopup(RenderWidgetHostViewQtDelegateClient *client) = 0; virtual void titleChanged(const QString&) = 0; virtual void urlChanged(const QUrl&) = 0; virtual void iconChanged(const QUrl&) = 0; diff --git a/src/core/web_contents_delegate_qt.cpp b/src/core/web_contents_delegate_qt.cpp index 4ac20825a..80b2330a8 100644 --- a/src/core/web_contents_delegate_qt.cpp +++ b/src/core/web_contents_delegate_qt.cpp @@ -71,7 +71,7 @@ void WebContentsDelegateQt::NavigationStateChanged(const content::WebContents* s void WebContentsDelegateQt::AddNewContents(content::WebContents* source, content::WebContents* new_contents, WindowOpenDisposition disposition, const gfx::Rect& initial_pos, bool user_gesture, bool* was_blocked) { - WebContentsAdapter *newAdapter = new WebContentsAdapter(WebEngineContext::current()->renderingMode(), new_contents); + WebContentsAdapter *newAdapter = new WebContentsAdapter(new_contents); // Do the first ref-count manually to be able to know if the application is handling adoptNewWindow through the public API. newAdapter->ref.ref(); diff --git a/src/core/web_contents_view_qt.cpp b/src/core/web_contents_view_qt.cpp index 8a9daeec0..61a17fec3 100644 --- a/src/core/web_contents_view_qt.cpp +++ b/src/core/web_contents_view_qt.cpp @@ -64,7 +64,7 @@ content::RenderWidgetHostView* WebContentsViewQt::CreateViewForWidget(content::R RenderWidgetHostViewQt *view = new RenderWidgetHostViewQt(render_widget_host); Q_ASSERT(m_factoryClient); - view->setDelegate(m_factoryClient->CreateRenderWidgetHostViewQtDelegate(view, WebEngineContext::current()->renderingMode())); + view->setDelegate(m_factoryClient->CreateRenderWidgetHostViewQtDelegate(view)); if (m_client) view->setAdapterClient(m_client); // Tell the RWHV delegate to attach itself to the native view container. @@ -78,7 +78,7 @@ content::RenderWidgetHostView* WebContentsViewQt::CreateViewForPopupWidget(conte RenderWidgetHostViewQt *view = new RenderWidgetHostViewQt(render_widget_host); Q_ASSERT(m_client); - view->setDelegate(m_client->CreateRenderWidgetHostViewQtDelegateForPopup(view, WebEngineContext::current()->renderingMode())); + view->setDelegate(m_client->CreateRenderWidgetHostViewQtDelegateForPopup(view)); view->setAdapterClient(m_client); return view; diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp index 1d4067fda..7fd7e577d 100644 --- a/src/core/web_engine_context.cpp +++ b/src/core/web_engine_context.cpp @@ -91,38 +91,22 @@ WebEngineContext::~WebEngineContext() m_runLoop->AfterRun(); } -scoped_refptr<WebEngineContext> WebEngineContext::currentOrCreate(WebContentsAdapterClient::RenderingMode renderingMode) +scoped_refptr<WebEngineContext> WebEngineContext::current() { if (!sContext) { - sContext = new WebEngineContext(renderingMode); + sContext = new WebEngineContext(); // Make sure that we ramp down Chromium before QApplication destroys its X connection, etc. qAddPostRoutine(destroyContext); - } else if (renderingMode != sContext->renderingMode()) - qFatal("Switching the QtWebEngine rendering mode once initialized in an application is not supported." - " If you're using both a QQuickWebView and a QtQuick WebEngineView, make sure that the" - " later is configured to use software rendering by setting:" - "\nqApp->setProperty(\"QQuickWebEngineView_DisableHardwareAcceleration\", QVariant(true));"); - return sContext; -} - -scoped_refptr<WebEngineContext> WebEngineContext::current() -{ + } return sContext; } -WebContentsAdapterClient::RenderingMode WebEngineContext::renderingMode() -{ - return CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableDelegatedRenderer) - ? WebContentsAdapterClient::HardwareAccelerationMode - : WebContentsAdapterClient::SoftwareRenderingMode; -} - #ifndef CHROMIUM_VERSION #error Chromium version should be defined at gyp-time. Something must have gone wrong #define CHROMIUM_VERSION // This is solely to keep Qt Creator happy. #endif -WebEngineContext::WebEngineContext(WebContentsAdapterClient::RenderingMode renderingMode) +WebEngineContext::WebEngineContext() : m_mainDelegate(new ContentMainDelegateQt) , m_contentRunner(content::ContentMainRunner::Create()) , m_browserRunner(content::BrowserMainRunner::Create()) @@ -142,12 +126,9 @@ WebEngineContext::WebEngineContext(WebContentsAdapterClient::RenderingMode rende parsedCommandLine->AppendSwitchPath(switches::kBrowserSubprocessPath, WebEngineLibraryInfo::getPath(content::CHILD_PROCESS_EXE)); parsedCommandLine->AppendSwitch(switches::kNoSandbox); parsedCommandLine->AppendSwitch(switches::kDisablePlugins); - - if (renderingMode == WebContentsAdapterClient::HardwareAccelerationMode && !parsedCommandLine->HasSwitch(switches::kDisableDelegatedRenderer)) { - parsedCommandLine->AppendSwitch(switches::kEnableDelegatedRenderer); - parsedCommandLine->AppendSwitch(switches::kEnableThreadedCompositing); - parsedCommandLine->AppendSwitch(switches::kInProcessGPU); - } + parsedCommandLine->AppendSwitch(switches::kEnableDelegatedRenderer); + parsedCommandLine->AppendSwitch(switches::kEnableThreadedCompositing); + parsedCommandLine->AppendSwitch(switches::kInProcessGPU); #if defined(OS_ANDROID) // Required on Android diff --git a/src/core/web_engine_context.h b/src/core/web_engine_context.h index cdd3e34b2..e0624afa1 100644 --- a/src/core/web_engine_context.h +++ b/src/core/web_engine_context.h @@ -42,8 +42,6 @@ #ifndef WEB_ENGINE_CONTEXT_H #define WEB_ENGINE_CONTEXT_H -#include "web_contents_adapter_client.h" - #include "base/memory/ref_counted.h" #include "base/memory/scoped_ptr.h" @@ -60,13 +58,11 @@ class ContentMainDelegateQt; class WebEngineContext : public base::RefCounted<WebEngineContext> { public: - static scoped_refptr<WebEngineContext> currentOrCreate(WebContentsAdapterClient::RenderingMode renderingMode); static scoped_refptr<WebEngineContext> current(); - WebContentsAdapterClient::RenderingMode renderingMode(); private: friend class base::RefCounted<WebEngineContext>; - WebEngineContext(WebContentsAdapterClient::RenderingMode renderingMode); + WebEngineContext(); ~WebEngineContext(); scoped_ptr<base::RunLoop> m_runLoop; diff --git a/src/webengine/api/qquickwebengineview.cpp b/src/webengine/api/qquickwebengineview.cpp index 587d3aa9f..93cc1c9a1 100644 --- a/src/webengine/api/qquickwebengineview.cpp +++ b/src/webengine/api/qquickwebengineview.cpp @@ -68,7 +68,7 @@ QT_BEGIN_NAMESPACE QQuickWebEngineViewPrivate::QQuickWebEngineViewPrivate() - : adapter(new WebContentsAdapter(qApp->property("QQuickWebEngineView_DisableHardwareAcceleration").toBool() ? SoftwareRenderingMode : HardwareAccelerationMode)) + : adapter(new WebContentsAdapter) , e(new QQuickWebEngineViewExperimental(this)) , v(new QQuickWebEngineViewport(this)) , m_history(new QQuickWebEngineHistory(this)) @@ -119,35 +119,23 @@ UIDelegatesManager *QQuickWebEngineViewPrivate::ui() return m_uIDelegatesManager.data(); } -RenderWidgetHostViewQtDelegate *QQuickWebEngineViewPrivate::CreateRenderWidgetHostViewQtDelegate(RenderWidgetHostViewQtDelegateClient *client, RenderingMode mode) +RenderWidgetHostViewQtDelegate *QQuickWebEngineViewPrivate::CreateRenderWidgetHostViewQtDelegate(RenderWidgetHostViewQtDelegateClient *client) { - if (mode == HardwareAccelerationMode) - return new RenderWidgetHostViewQtDelegateQuick(client, /*isPopup = */ false); - return new RenderWidgetHostViewQtDelegateQuickPainted(client, false); + return new RenderWidgetHostViewQtDelegateQuick(client, /*isPopup = */ false); } -RenderWidgetHostViewQtDelegate *QQuickWebEngineViewPrivate::CreateRenderWidgetHostViewQtDelegateForPopup(RenderWidgetHostViewQtDelegateClient *client, WebContentsAdapterClient::RenderingMode mode) +RenderWidgetHostViewQtDelegate *QQuickWebEngineViewPrivate::CreateRenderWidgetHostViewQtDelegateForPopup(RenderWidgetHostViewQtDelegateClient *client) { Q_Q(QQuickWebEngineView); const bool hasWindowCapability = QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::MultipleWindows); - if (mode == HardwareAccelerationMode) { - RenderWidgetHostViewQtDelegateQuick *quickDelegate = new RenderWidgetHostViewQtDelegateQuick(client, /*isPopup = */true); - if (hasWindowCapability) { - RenderWidgetHostViewQtDelegateQuickWindow *wrapperWindow = new RenderWidgetHostViewQtDelegateQuickWindow(quickDelegate); - quickDelegate->setParentItem(wrapperWindow->contentItem()); - return wrapperWindow; - } - quickDelegate->setParentItem(q); - return quickDelegate; - } - RenderWidgetHostViewQtDelegateQuickPainted *paintedDelegate = new RenderWidgetHostViewQtDelegateQuickPainted(client, /*isPopup = */true); + RenderWidgetHostViewQtDelegateQuick *quickDelegate = new RenderWidgetHostViewQtDelegateQuick(client, /*isPopup = */ true); if (hasWindowCapability) { - RenderWidgetHostViewQtDelegateQuickWindow *wrapperWindow = new RenderWidgetHostViewQtDelegateQuickWindow(paintedDelegate); - paintedDelegate->setParentItem(wrapperWindow->contentItem()); + RenderWidgetHostViewQtDelegateQuickWindow *wrapperWindow = new RenderWidgetHostViewQtDelegateQuickWindow(quickDelegate); + quickDelegate->setParentItem(wrapperWindow->contentItem()); return wrapperWindow; } - paintedDelegate->setParentItem(q); - return paintedDelegate; + quickDelegate->setParentItem(q); + return quickDelegate; } bool QQuickWebEngineViewPrivate::contextMenuRequested(const WebEngineContextMenuData &data) @@ -509,8 +497,7 @@ void QQuickWebEngineView::setInspectable(bool enable) void QQuickWebEngineView::forceActiveFocus() { Q_FOREACH (QQuickItem *child, childItems()) { - if (qobject_cast<RenderWidgetHostViewQtDelegateQuick *>(child) - || qobject_cast<RenderWidgetHostViewQtDelegateQuickPainted *>(child)) { + if (qobject_cast<RenderWidgetHostViewQtDelegateQuick *>(child)) { child->forceActiveFocus(); break; } @@ -578,8 +565,7 @@ void QQuickWebEngineView::geometryChanged(const QRectF &newGeometry, const QRect QQuickItem::geometryChanged(newGeometry, oldGeometry); Q_FOREACH(QQuickItem *child, childItems()) { - Q_ASSERT(qobject_cast<RenderWidgetHostViewQtDelegateQuick *>(child) - || qobject_cast<RenderWidgetHostViewQtDelegateQuickPainted *>(child)); + Q_ASSERT(qobject_cast<RenderWidgetHostViewQtDelegateQuick *>(child)); child->setSize(newGeometry.size()); } } diff --git a/src/webengine/api/qquickwebengineview_p_p.h b/src/webengine/api/qquickwebengineview_p_p.h index cf9d58e68..2fcca73b7 100644 --- a/src/webengine/api/qquickwebengineview_p_p.h +++ b/src/webengine/api/qquickwebengineview_p_p.h @@ -125,8 +125,8 @@ public: QQuickWebEngineViewport *viewport() const; UIDelegatesManager *ui(); - virtual RenderWidgetHostViewQtDelegate* CreateRenderWidgetHostViewQtDelegate(RenderWidgetHostViewQtDelegateClient *client, RenderingMode) Q_DECL_OVERRIDE; - virtual RenderWidgetHostViewQtDelegate* CreateRenderWidgetHostViewQtDelegateForPopup(RenderWidgetHostViewQtDelegateClient *client, RenderingMode mode) Q_DECL_OVERRIDE; + virtual RenderWidgetHostViewQtDelegate* CreateRenderWidgetHostViewQtDelegate(RenderWidgetHostViewQtDelegateClient *client) Q_DECL_OVERRIDE; + virtual RenderWidgetHostViewQtDelegate* CreateRenderWidgetHostViewQtDelegateForPopup(RenderWidgetHostViewQtDelegateClient *client) Q_DECL_OVERRIDE; virtual void titleChanged(const QString&) Q_DECL_OVERRIDE; virtual void urlChanged(const QUrl&) Q_DECL_OVERRIDE; virtual void iconChanged(const QUrl&) Q_DECL_OVERRIDE; diff --git a/src/webengine/render_widget_host_view_qt_delegate_quick.cpp b/src/webengine/render_widget_host_view_qt_delegate_quick.cpp index e2804ef9b..c755619e8 100644 --- a/src/webengine/render_widget_host_view_qt_delegate_quick.cpp +++ b/src/webengine/render_widget_host_view_qt_delegate_quick.cpp @@ -47,16 +47,11 @@ RenderWidgetHostViewQtDelegateQuick::RenderWidgetHostViewQtDelegateQuick(RenderW setFlag(ItemHasContents); } -void RenderWidgetHostViewQtDelegateQuick::update(const QRect&) +void RenderWidgetHostViewQtDelegateQuick::update() { QQuickItem::update(); } -bool RenderWidgetHostViewQtDelegateQuick::supportsHardwareAcceleration() const -{ - return true; -} - void RenderWidgetHostViewQtDelegateQuick::itemChange(ItemChange change, const ItemChangeData &value) { QQuickItem::itemChange(change, value); @@ -68,27 +63,3 @@ QSGNode *RenderWidgetHostViewQtDelegateQuick::updatePaintNode(QSGNode *oldNode, { return m_client->updatePaintNode(oldNode, QQuickWindowPrivate::get(QQuickItem::window())->context); } - -RenderWidgetHostViewQtDelegateQuickPainted::RenderWidgetHostViewQtDelegateQuickPainted(RenderWidgetHostViewQtDelegateClient *client, bool isPopup) - : RenderWidgetHostViewQtDelegateQuickBase<QQuickPaintedItem>(client, isPopup) -{ -} - -void RenderWidgetHostViewQtDelegateQuickPainted::update(const QRect& rect) -{ - polish(); - QQuickPaintedItem::update(rect); -} - -void RenderWidgetHostViewQtDelegateQuickPainted::paint(QPainter *painter) -{ - m_client->paint(painter, boundingRect()); -} - -void RenderWidgetHostViewQtDelegateQuickPainted::updatePolish() -{ - // paint will be called from the scene graph thread and this doesn't play well - // with chromium's use of TLS while getting the backing store. - // updatePolish() should be called from the GUI thread right before the rendering thread starts. - m_client->fetchBackingStore(); -} diff --git a/src/webengine/render_widget_host_view_qt_delegate_quick.h b/src/webengine/render_widget_host_view_qt_delegate_quick.h index 47884068e..03e39a8d2 100644 --- a/src/webengine/render_widget_host_view_qt_delegate_quick.h +++ b/src/webengine/render_widget_host_view_qt_delegate_quick.h @@ -136,11 +136,6 @@ public: this->setSize(QSizeF(width, height)); } - virtual bool supportsHardwareAcceleration() const Q_DECL_OVERRIDE - { - return false; - } - virtual void move(const QPoint&) Q_DECL_OVERRIDE {} void focusInEvent(QFocusEvent *event) @@ -240,25 +235,9 @@ class RenderWidgetHostViewQtDelegateQuick : public RenderWidgetHostViewQtDelegat public: RenderWidgetHostViewQtDelegateQuick(RenderWidgetHostViewQtDelegateClient *client, bool isPopup); - virtual void update(const QRect& rect = QRect()) Q_DECL_OVERRIDE; - virtual bool supportsHardwareAcceleration() const Q_DECL_OVERRIDE; + virtual void update() Q_DECL_OVERRIDE; virtual void itemChange(ItemChange change, const ItemChangeData &value) Q_DECL_OVERRIDE; virtual QSGNode *updatePaintNode(QSGNode *, UpdatePaintNodeData *) Q_DECL_OVERRIDE; }; - -class RenderWidgetHostViewQtDelegateQuickPainted : public RenderWidgetHostViewQtDelegateQuickBase<QQuickPaintedItem> -{ - Q_OBJECT -public: - RenderWidgetHostViewQtDelegateQuickPainted(RenderWidgetHostViewQtDelegateClient *client, bool isPopup); - - virtual void update(const QRect& rect = QRect()) Q_DECL_OVERRIDE; - - void paint(QPainter *painter); - -protected: - void updatePolish(); -}; - #endif diff --git a/src/webengine/render_widget_host_view_qt_delegate_quickwindow.cpp b/src/webengine/render_widget_host_view_qt_delegate_quickwindow.cpp index 7bf19d17a..04b75bd6b 100644 --- a/src/webengine/render_widget_host_view_qt_delegate_quickwindow.cpp +++ b/src/webengine/render_widget_host_view_qt_delegate_quickwindow.cpp @@ -94,9 +94,8 @@ QWindow *RenderWidgetHostViewQtDelegateQuickWindow::window() const return const_cast<RenderWidgetHostViewQtDelegateQuickWindow*>(this); } -void RenderWidgetHostViewQtDelegateQuickWindow::update(const QRect &rect) +void RenderWidgetHostViewQtDelegateQuickWindow::update() { - Q_UNUSED(rect); QQuickWindow::update(); m_realDelegate->update(); } diff --git a/src/webengine/render_widget_host_view_qt_delegate_quickwindow.h b/src/webengine/render_widget_host_view_qt_delegate_quickwindow.h index 6adac5e95..667bb4b3a 100644 --- a/src/webengine/render_widget_host_view_qt_delegate_quickwindow.h +++ b/src/webengine/render_widget_host_view_qt_delegate_quickwindow.h @@ -64,18 +64,13 @@ public: virtual void hide() Q_DECL_OVERRIDE; virtual bool isVisible() const Q_DECL_OVERRIDE; virtual QWindow* window() const Q_DECL_OVERRIDE; - virtual void update(const QRect& rect = QRect()) Q_DECL_OVERRIDE; + virtual void update() Q_DECL_OVERRIDE; virtual void updateCursor(const QCursor &) Q_DECL_OVERRIDE; virtual void resize(int width, int height) Q_DECL_OVERRIDE; virtual void move(const QPoint &screenPos) Q_DECL_OVERRIDE; virtual void inputMethodStateChanged(bool) Q_DECL_OVERRIDE {} - virtual bool supportsHardwareAcceleration() const Q_DECL_OVERRIDE - { - return m_realDelegate->supportsHardwareAcceleration(); - } virtual void setTooltip(const QString &tooltip) Q_DECL_OVERRIDE; - private: QScopedPointer<RenderWidgetHostViewQtDelegate> m_realDelegate; }; diff --git a/src/webenginewidgets/api/qwebenginepage.cpp b/src/webenginewidgets/api/qwebenginepage.cpp index a879a94ef..dbd78acd0 100644 --- a/src/webenginewidgets/api/qwebenginepage.cpp +++ b/src/webenginewidgets/api/qwebenginepage.cpp @@ -148,7 +148,7 @@ void CallbackDirectory::CallbackSharedDataPointer::doDeref() QWebEnginePagePrivate::QWebEnginePagePrivate() : QObjectPrivate(QObjectPrivateVersion) - , adapter(new WebContentsAdapter(HardwareAccelerationMode)) + , adapter(new WebContentsAdapter) , history(new QWebEngineHistory(new QWebEngineHistoryPrivate(this))) , view(0) { @@ -161,9 +161,8 @@ QWebEnginePagePrivate::~QWebEnginePagePrivate() delete history; } -RenderWidgetHostViewQtDelegate *QWebEnginePagePrivate::CreateRenderWidgetHostViewQtDelegate(RenderWidgetHostViewQtDelegateClient *client, RenderingMode mode) +RenderWidgetHostViewQtDelegate *QWebEnginePagePrivate::CreateRenderWidgetHostViewQtDelegate(RenderWidgetHostViewQtDelegateClient *client) { - Q_UNUSED(mode); return new RenderWidgetHostViewQtDelegateWidget(client); } @@ -353,7 +352,7 @@ void QWebEnginePagePrivate::_q_webActionTriggered(bool checked) void QWebEnginePagePrivate::recreateFromSerializedHistory(QDataStream &input) { - QExplicitlySharedDataPointer<WebContentsAdapter> newWebContents = WebContentsAdapter::createFromSerializedNavigationHistory(input, this, WebContentsAdapterClient::HardwareAccelerationMode); + QExplicitlySharedDataPointer<WebContentsAdapter> newWebContents = WebContentsAdapter::createFromSerializedNavigationHistory(input, this); if (newWebContents) { adapter = newWebContents.data(); adapter->initialize(this); diff --git a/src/webenginewidgets/api/qwebenginepage_p.h b/src/webenginewidgets/api/qwebenginepage_p.h index e487ff37c..947c57317 100644 --- a/src/webenginewidgets/api/qwebenginepage_p.h +++ b/src/webenginewidgets/api/qwebenginepage_p.h @@ -108,8 +108,8 @@ public: QWebEnginePagePrivate(); ~QWebEnginePagePrivate(); - virtual RenderWidgetHostViewQtDelegate* CreateRenderWidgetHostViewQtDelegate(RenderWidgetHostViewQtDelegateClient *client, RenderingMode mode) Q_DECL_OVERRIDE; - virtual RenderWidgetHostViewQtDelegate* CreateRenderWidgetHostViewQtDelegateForPopup(RenderWidgetHostViewQtDelegateClient *client, RenderingMode mode) Q_DECL_OVERRIDE { return CreateRenderWidgetHostViewQtDelegate(client, mode); } + virtual RenderWidgetHostViewQtDelegate* CreateRenderWidgetHostViewQtDelegate(RenderWidgetHostViewQtDelegateClient *client) Q_DECL_OVERRIDE; + virtual RenderWidgetHostViewQtDelegate* CreateRenderWidgetHostViewQtDelegateForPopup(RenderWidgetHostViewQtDelegateClient *client) Q_DECL_OVERRIDE { return CreateRenderWidgetHostViewQtDelegate(client); } virtual void titleChanged(const QString&) Q_DECL_OVERRIDE; virtual void urlChanged(const QUrl&) Q_DECL_OVERRIDE; virtual void iconChanged(const QUrl&) Q_DECL_OVERRIDE; diff --git a/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp b/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp index 308735f70..19f7272be 100644 --- a/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp +++ b/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp @@ -129,7 +129,7 @@ QWindow* RenderWidgetHostViewQtDelegateWidget::window() const return root ? root->windowHandle() : 0; } -void RenderWidgetHostViewQtDelegateWidget::update(const QRect&) +void RenderWidgetHostViewQtDelegateWidget::update() { updateGL(); } @@ -170,11 +170,6 @@ QVariant RenderWidgetHostViewQtDelegateWidget::inputMethodQuery(Qt::InputMethodQ return m_client->inputMethodQuery(query); } -bool RenderWidgetHostViewQtDelegateWidget::supportsHardwareAcceleration() const -{ - return true; -} - void RenderWidgetHostViewQtDelegateWidget::resizeEvent(QResizeEvent *resizeEvent) { QOpenGLWidget::resizeEvent(resizeEvent); diff --git a/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.h b/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.h index 6a77d8321..7c3492e17 100644 --- a/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.h +++ b/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.h @@ -69,12 +69,11 @@ public: virtual void hide() Q_DECL_OVERRIDE; virtual bool isVisible() const Q_DECL_OVERRIDE; virtual QWindow* window() const Q_DECL_OVERRIDE; - virtual void update(const QRect& rect = QRect()) Q_DECL_OVERRIDE; + virtual void update() Q_DECL_OVERRIDE; virtual void updateCursor(const QCursor &) Q_DECL_OVERRIDE; virtual void resize(int width, int height) Q_DECL_OVERRIDE; virtual void move(const QPoint &screenPos) Q_DECL_OVERRIDE; virtual void inputMethodStateChanged(bool editorVisible) Q_DECL_OVERRIDE; - virtual bool supportsHardwareAcceleration() const Q_DECL_OVERRIDE; virtual void setTooltip(const QString &tooltip) Q_DECL_OVERRIDE; protected: diff --git a/tests/auto/quick/qquickwebviewgraphics/qquickwebviewgraphics_software.pro b/tests/auto/quick/qquickwebviewgraphics/qquickwebviewgraphics_software.pro deleted file mode 100644 index 07ef8be5b..000000000 --- a/tests/auto/quick/qquickwebviewgraphics/qquickwebviewgraphics_software.pro +++ /dev/null @@ -1,6 +0,0 @@ -TARGET = qquickwebviewgraphics -include(../tests.pri) -TARGET = $${TARGET}_software -OBJECTS_DIR = $${OBJECTS_DIR}_software - -DEFINES += TST_QQUICKWEBVIEWGRAPHICS_SOFTWARE=1
\ No newline at end of file diff --git a/tests/auto/quick/qquickwebviewgraphics/tst_qquickwebviewgraphics.cpp b/tests/auto/quick/qquickwebviewgraphics/tst_qquickwebviewgraphics.cpp index 213420b13..2595514a7 100644 --- a/tests/auto/quick/qquickwebviewgraphics/tst_qquickwebviewgraphics.cpp +++ b/tests/auto/quick/qquickwebviewgraphics/tst_qquickwebviewgraphics.cpp @@ -109,11 +109,7 @@ tst_QQuickWebViewGraphics::~tst_QQuickWebViewGraphics() // It is only called once. void tst_QQuickWebViewGraphics::initTestCase() { -#if defined(TST_QQUICKWEBVIEWGRAPHICS_SOFTWARE) - qApp->setProperty("QQuickWebEngineView_DisableHardwareAcceleration", QVariant(true)); -#else QWebEngine::initialize(); -#endif } void tst_QQuickWebViewGraphics::init() diff --git a/tests/auto/quick/quick.pro b/tests/auto/quick/quick.pro index e679184b6..bc92de6e4 100644 --- a/tests/auto/quick/quick.pro +++ b/tests/auto/quick/quick.pro @@ -1,8 +1,6 @@ TEMPLATE = subdirs SUBDIRS += \ - qquickwebviewgraphics/qquickwebviewgraphics_software.pro \ - publicapi/publicapi.pro \ - qmltests/qmltests.pro \ - -equals(QT_MAJOR_VERSION, 5):greaterThan(QT_MINOR_VERSION, 1): SUBDIRS += qquickwebviewgraphics/qquickwebviewgraphics.pro + publicapi \ + qmltests \ + qquickwebviewgraphics |