Accepting request 505873 from KDE:Qt5
- Add upstream patch support-non-integer-pixel-ratios-qquickwidget.patch * Add support for non-integer scaling to QQuickWidget (QTBUG-61502) OBS-URL: https://build.opensuse.org/request/show/505873 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libqt5-qtdeclarative?expand=0&rev=38
This commit is contained in:
parent
99f2151f16
commit
6cfee3deaf
@ -1,3 +1,9 @@
|
||||
-------------------------------------------------------------------
|
||||
Fri Jun 23 11:46:39 UTC 2017 - lbeltrame@kde.org
|
||||
|
||||
- Add upstream patch support-non-integer-pixel-ratios-qquickwidget.patch
|
||||
* Add support for non-integer scaling to QQuickWidget (QTBUG-61502)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed May 31 07:05:09 UTC 2017 - fabian@ritter-vogt.de
|
||||
|
||||
|
@ -33,6 +33,8 @@ Url: https://www.qt.io
|
||||
%define tar_version qtdeclarative-opensource-src-%{real_version}
|
||||
Source: https://download.qt.io/official_releases/qt/5.9/%{real_version}/submodules/%{tar_version}.tar.xz
|
||||
Source1: baselibs.conf
|
||||
# PATCH-FIX-UPSTREAM
|
||||
Patch1: support-non-integer-pixel-ratios-qquickwidget.patch
|
||||
# PATCH-FIX-OPENSUSE sse2_nojit.patch -- enable JIT and sse2 only on sse2 case
|
||||
Patch100: sse2_nojit.patch
|
||||
BuildRequires: fdupes
|
||||
@ -74,6 +76,7 @@ handling.
|
||||
%ifarch %ix86
|
||||
%patch100 -p1
|
||||
%endif
|
||||
%patch1 -p1
|
||||
|
||||
%package -n %libname
|
||||
Summary: Qt 5 Declarative Library
|
||||
|
73
support-non-integer-pixel-ratios-qquickwidget.patch
Normal file
73
support-non-integer-pixel-ratios-qquickwidget.patch
Normal file
@ -0,0 +1,73 @@
|
||||
From dfce0a8feceeb7156eba6ac5d8d3521e3009a583 Mon Sep 17 00:00:00 2001
|
||||
From: Allan Sandfeld Jensen <allan.jensen@qt.io>
|
||||
Date: Wed, 21 Jun 2017 09:03:22 +0200
|
||||
Subject: [PATCH] Support non-integer pixel-ratio in QQuickWidget
|
||||
|
||||
Non-integer pixel-ratios always resulted in blurry rendering when
|
||||
QQuickWidget was used, but not with QQuickWindow. Fixed by reading qreal
|
||||
accessor of devicePixelRatio instead.
|
||||
|
||||
Change-Id: I49f5efcf2da2efc090c00017e68c99c857cd84ef
|
||||
Task-number: QTBUG-61502
|
||||
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
|
||||
---
|
||||
src/quickwidgets/qquickwidget.cpp | 14 ++++++++------
|
||||
1 file changed, 8 insertions(+), 6 deletions(-)
|
||||
|
||||
Index: qtdeclarative-opensource-src-5.9.0/src/quickwidgets/qquickwidget.cpp
|
||||
===================================================================
|
||||
--- qtdeclarative-opensource-src-5.9.0.orig/src/quickwidgets/qquickwidget.cpp
|
||||
+++ qtdeclarative-opensource-src-5.9.0/src/quickwidgets/qquickwidget.cpp
|
||||
@@ -913,9 +913,9 @@ void QQuickWidget::createFramebufferObje
|
||||
d->offscreenWindow->setGeometry(globalPos.x(), globalPos.y(), width(), height());
|
||||
|
||||
if (d->useSoftwareRenderer) {
|
||||
- const QSize imageSize = size() * devicePixelRatio();
|
||||
+ const QSize imageSize = size() * devicePixelRatioF();
|
||||
d->softwareImage = QImage(imageSize, QImage::Format_ARGB32_Premultiplied);
|
||||
- d->softwareImage.setDevicePixelRatio(devicePixelRatio());
|
||||
+ d->softwareImage.setDevicePixelRatio(devicePixelRatioF());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -960,7 +960,7 @@ void QQuickWidget::createFramebufferObje
|
||||
format.setInternalTextureFormat(GL_SRGB8_ALPHA8_EXT);
|
||||
#endif
|
||||
|
||||
- const QSize fboSize = size() * devicePixelRatio();
|
||||
+ const QSize fboSize = size() * devicePixelRatioF();
|
||||
|
||||
// Could be a simple hide - show, in which case the previous fbo is just fine.
|
||||
if (!d->fbo || d->fbo->size() != fboSize) {
|
||||
@@ -1181,7 +1181,7 @@ void QQuickWidget::resizeEvent(QResizeEv
|
||||
// Software Renderer
|
||||
if (d->useSoftwareRenderer) {
|
||||
needsSync = true;
|
||||
- if (d->softwareImage.size() != size() * devicePixelRatio()) {
|
||||
+ if (d->softwareImage.size() != size() * devicePixelRatioF()) {
|
||||
createFramebufferObject();
|
||||
}
|
||||
} else {
|
||||
@@ -1191,7 +1191,7 @@ void QQuickWidget::resizeEvent(QResizeEv
|
||||
// during hide - resize - show sequences and also during application exit.
|
||||
if (!d->fbo && !d->offscreenWindow->openglContext())
|
||||
return;
|
||||
- if (!d->fbo || d->fbo->size() != size() * devicePixelRatio()) {
|
||||
+ if (!d->fbo || d->fbo->size() != size() * devicePixelRatioF()) {
|
||||
needsSync = true;
|
||||
createFramebufferObject();
|
||||
}
|
||||
@@ -1604,10 +1604,12 @@ void QQuickWidget::paintEvent(QPaintEven
|
||||
//Paint everything
|
||||
painter.drawImage(rect(), d->softwareImage);
|
||||
} else {
|
||||
+ QTransform transform;
|
||||
+ transform.scale(devicePixelRatioF(), devicePixelRatioF());
|
||||
//Paint only the updated areas
|
||||
const auto rects = d->updateRegion.rects();
|
||||
for (auto targetRect : rects) {
|
||||
- auto sourceRect = QRect(targetRect.topLeft() * devicePixelRatio(), targetRect.size() * devicePixelRatio());
|
||||
+ auto sourceRect = transform.mapRect(QRectF(targetRect));
|
||||
painter.drawImage(targetRect, d->softwareImage, sourceRect);
|
||||
}
|
||||
d->updateRegion = QRegion();
|
Loading…
Reference in New Issue
Block a user