summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Source/WebKit2/ChangeLog26
-rw-r--r--Source/WebKit2/UIProcess/API/qt/qquickwebpage.cpp7
-rw-r--r--Source/WebKit2/UIProcess/qt/QtWebPageSGNode.cpp11
-rw-r--r--Source/WebKit2/UIProcess/qt/QtWebPageSGNode.h7
4 files changed, 37 insertions, 14 deletions
diff --git a/Source/WebKit2/ChangeLog b/Source/WebKit2/ChangeLog
index e5da2b6c6..9e62458eb 100644
--- a/Source/WebKit2/ChangeLog
+++ b/Source/WebKit2/ChangeLog
@@ -48,6 +48,32 @@
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::sendViewportAttributesChanged):
+2013-01-03 Jocelyn Turcotte <jocelyn.turcotte@digia.com>
+
+ [Qt] Fix a crash when the QQuickWebPage is destroyed between the scene graph sync and render.
+ https://bugs.webkit.org/show_bug.cgi?id=106018
+
+ Reviewed by Simon Hausmann.
+
+ The main and rendering threads are only guaranteed to be synchronised in
+ the updatePaintNode call. In every other cases, QQuickItems cannot be
+ safely accessed from the rendering thread.
+
+ Do as the first patch version in
+ https://bugs.webkit.org/show_bug.cgi?id=104574 was doing and copy the
+ ratio value directly to fix the issue.
+
+ Also add a note about the threading issue in QQuickWebPage::updatePaintNode.
+
+ * UIProcess/API/qt/qquickwebpage.cpp:
+ (QQuickWebPage::updatePaintNode):
+ * UIProcess/qt/QtWebPageSGNode.cpp:
+ (WebKit::QtWebPageSGNode::QtWebPageSGNode):
+ * UIProcess/qt/QtWebPageSGNode.h:
+ (QtWebPageSGNode):
+ (WebKit::QtWebPageSGNode::devicePixelRatio):
+ (WebKit::QtWebPageSGNode::setDevicePixelRatio):
+
2012-12-19 Kenneth Rohde Christiansen <kenneth@webkit.org>
[EFL][Qt][WK2] Going back to 47-amazing-css3-animation-demos shows nothing or wrong position
diff --git a/Source/WebKit2/UIProcess/API/qt/qquickwebpage.cpp b/Source/WebKit2/UIProcess/API/qt/qquickwebpage.cpp
index a1f35ae47..a7d74b2e2 100644
--- a/Source/WebKit2/UIProcess/API/qt/qquickwebpage.cpp
+++ b/Source/WebKit2/UIProcess/API/qt/qquickwebpage.cpp
@@ -91,15 +91,18 @@ QSGNode* QQuickWebPage::updatePaintNode(QSGNode* oldNode, UpdatePaintNodeData*)
if (window && d->webPageProxy->deviceScaleFactor() != window->devicePixelRatio()) {
d->webPageProxy->setIntrinsicDeviceScaleFactor(window->devicePixelRatio());
- d->viewportItem->experimental()->test()->devicePixelRatioChanged();
+ // This signal is queued since if we are running a threaded renderer. This might cause failures
+ // if tests are reading the new value between the property change and the signal emission.
+ emit d->viewportItem->experimental()->test()->devicePixelRatioChanged();
}
if (!node)
- node = new QtWebPageSGNode(this);
+ node = new QtWebPageSGNode;
node->setRenderer(renderer);
node->setScale(d->contentsScale);
+ node->setDevicePixelRatio(window->devicePixelRatio());
QColor backgroundColor = d->webPageProxy->drawsTransparentBackground() ? Qt::transparent : Qt::white;
QRectF backgroundRect(QPointF(0, 0), d->contentsSize);
node->setBackground(backgroundRect, backgroundColor);
diff --git a/Source/WebKit2/UIProcess/qt/QtWebPageSGNode.cpp b/Source/WebKit2/UIProcess/qt/QtWebPageSGNode.cpp
index 146462ade..f536c4217 100644
--- a/Source/WebKit2/UIProcess/qt/QtWebPageSGNode.cpp
+++ b/Source/WebKit2/UIProcess/qt/QtWebPageSGNode.cpp
@@ -129,10 +129,10 @@ private:
RefPtr<LayerTreeRenderer> m_renderer;
};
-QtWebPageSGNode::QtWebPageSGNode(const QQuickItem* item)
+QtWebPageSGNode::QtWebPageSGNode()
: m_contentsNode(0)
, m_backgroundNode(new QSGSimpleRectNode)
- , m_item(item)
+ , m_devicePixelRatio(1)
{
appendChildNode(m_backgroundNode);
}
@@ -150,13 +150,6 @@ void QtWebPageSGNode::setScale(float scale)
setMatrix(matrix);
}
-qreal QtWebPageSGNode::devicePixelRatio() const
-{
- if (const QWindow* window = m_item->window())
- return window->devicePixelRatio();
- return 1;
-}
-
void QtWebPageSGNode::setRenderer(PassRefPtr<LayerTreeRenderer> renderer)
{
if (m_contentsNode && m_contentsNode->layerTreeRenderer() == renderer)
diff --git a/Source/WebKit2/UIProcess/qt/QtWebPageSGNode.h b/Source/WebKit2/UIProcess/qt/QtWebPageSGNode.h
index 368df704a..1bcc28e43 100644
--- a/Source/WebKit2/UIProcess/qt/QtWebPageSGNode.h
+++ b/Source/WebKit2/UIProcess/qt/QtWebPageSGNode.h
@@ -36,16 +36,17 @@ class LayerTreeRenderer;
class QtWebPageSGNode : public QSGTransformNode {
public:
- QtWebPageSGNode(const QQuickItem*);
+ QtWebPageSGNode();
void setBackground(const QRectF&, const QColor&);
void setScale(float);
void setRenderer(PassRefPtr<LayerTreeRenderer>);
- qreal devicePixelRatio() const;
+ qreal devicePixelRatio() const { return m_devicePixelRatio; }
+ void setDevicePixelRatio(qreal devicePixelRatio) { m_devicePixelRatio = devicePixelRatio; }
private:
ContentsSGNode* m_contentsNode;
QSGSimpleRectNode* m_backgroundNode;
- const QQuickItem* const m_item;
+ qreal m_devicePixelRatio;
};
} // namespace WebKit