aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2016-10-05 19:32:12 +0200
committerLiang Qi <liang.qi@qt.io>2016-10-05 19:32:12 +0200
commitfff4477661ae240c43088fa6d9069ccf969dbee8 (patch)
treed654a5f841cc6abe758c8626bbf51be6bdcdea26 /src/quick/items
parent3a205800c6ea0a88ae2ab35edabf6883e54a334b (diff)
parent59e48836e207aff52b2727cc4f3733209475e8bb (diff)
Merge remote-tracking branch 'origin/5.6' into 5.7
Diffstat (limited to 'src/quick/items')
-rw-r--r--src/quick/items/context2d/qquickcontext2dtexture.cpp12
-rw-r--r--src/quick/items/qquickpositioners.cpp8
-rw-r--r--src/quick/items/qquickrectangle.cpp2
3 files changed, 15 insertions, 7 deletions
diff --git a/src/quick/items/context2d/qquickcontext2dtexture.cpp b/src/quick/items/context2d/qquickcontext2dtexture.cpp
index f3513f447a..375f537b9b 100644
--- a/src/quick/items/context2d/qquickcontext2dtexture.cpp
+++ b/src/quick/items/context2d/qquickcontext2dtexture.cpp
@@ -544,6 +544,9 @@ QPaintDevice* QQuickContext2DFBOTexture::beginPainting()
{
QQuickContext2DTexture::beginPainting();
+ const qreal devicePixelRatio = (m_item && m_item->window()) ?
+ m_item->window()->effectiveDevicePixelRatio() : qApp->devicePixelRatio();
+
if (m_canvasWindow.size().isEmpty()) {
delete m_fbo;
delete m_multisampledFbo;
@@ -558,7 +561,7 @@ QPaintDevice* QQuickContext2DFBOTexture::beginPainting()
delete m_paint_device;
m_paint_device = 0;
- m_fboSize = npotAdjustedSize(m_canvasWindow.size());
+ m_fboSize = npotAdjustedSize(m_canvasWindow.size() * devicePixelRatio);
m_canvasWindowChanged = false;
if (doMultisampling()) {
@@ -596,6 +599,7 @@ QPaintDevice* QQuickContext2DFBOTexture::beginPainting()
QOpenGLPaintDevice *gl_device = new QOpenGLPaintDevice(m_fbo->size());
gl_device->setPaintFlipped(true);
gl_device->setSize(m_fbo->size());
+ gl_device->setDevicePixelRatio(devicePixelRatio);
m_paint_device = gl_device;
}
@@ -700,8 +704,12 @@ QPaintDevice* QQuickContext2DImageTexture::beginPainting()
if (m_canvasWindow.size().isEmpty())
return 0;
+ const qreal devicePixelRatio = (m_item && m_item->window()) ?
+ m_item->window()->effectiveDevicePixelRatio() : qApp->devicePixelRatio();
+
if (m_canvasWindowChanged) {
- m_image = QImage(m_canvasWindow.size(), QImage::Format_ARGB32_Premultiplied);
+ m_image = QImage(m_canvasWindow.size() * devicePixelRatio, QImage::Format_ARGB32_Premultiplied);
+ m_image.setDevicePixelRatio(devicePixelRatio);
m_image.fill(0x00000000);
m_canvasWindowChanged = false;
}
diff --git a/src/quick/items/qquickpositioners.cpp b/src/quick/items/qquickpositioners.cpp
index 38e89e78eb..e22427ca49 100644
--- a/src/quick/items/qquickpositioners.cpp
+++ b/src/quick/items/qquickpositioners.cpp
@@ -872,7 +872,7 @@ void QQuickPositionerAttached::setIsLastItem(bool isLastItem)
the item that is being added. See the \l ViewTransition documentation for more details
and examples on using these transitions.
- \note This transition is not applied to the items that already part of the positioner
+ \note This transition is not applied to the items that are already part of the positioner
at the time of its creation. In this case, the \l populate transition is applied instead.
\sa populate, ViewTransition, {Qt Quick Examples - Positioners}
@@ -1039,7 +1039,7 @@ void QQuickColumn::reportConflictingAnchors()
the item that is being added. See the \l ViewTransition documentation for more details
and examples on using these transitions.
- \note This transition is not applied to the items that already part of the positioner
+ \note This transition is not applied to the items that are already part of the positioner
at the time of its creation. In this case, the \l populate transition is applied instead.
\sa populate, ViewTransition, {Qt Quick Examples - Positioners}
@@ -1307,7 +1307,7 @@ void QQuickRow::reportConflictingAnchors()
the item that is being added. See the \l ViewTransition documentation for more details
and examples on using these transitions.
- \note This transition is not applied to the items that already part of the positioner
+ \note This transition is not applied to the items that are already part of the positioner
at the time of its creation. In this case, the \l populate transition is applied instead.
\sa populate, ViewTransition, {Qt Quick Examples - Positioners}
@@ -1882,7 +1882,7 @@ void QQuickGrid::reportConflictingAnchors()
the item that is being added. See the \l ViewTransition documentation for more details
and examples on using these transitions.
- \note This transition is not applied to the items that already part of the positioner
+ \note This transition is not applied to the items that are already part of the positioner
at the time of its creation. In this case, the \l populate transition is applied instead.
\sa populate, ViewTransition, {Qt Quick Examples - Positioners}
diff --git a/src/quick/items/qquickrectangle.cpp b/src/quick/items/qquickrectangle.cpp
index 74ca0f482a..05ff0c0fda 100644
--- a/src/quick/items/qquickrectangle.cpp
+++ b/src/quick/items/qquickrectangle.cpp
@@ -366,7 +366,7 @@ QQuickPen *QQuickRectangle::border()
The gradient to use to fill the rectangle.
This property allows for the construction of simple vertical gradients.
- Other gradients may by formed by adding rotation to the rectangle.
+ Other gradients may be formed by adding rotation to the rectangle.
\div {class="float-left"}
\inlineimage declarative-rect_gradient.png