summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKai Uwe Broulik <kde@privat.broulik.de>2023-10-20 14:22:15 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2024-01-06 19:14:08 +0000
commitf271351b863d56145c2e9ed62d5c9f6a90b5436c (patch)
treed492f6f29e8d2e9a39d08f9b1901189ea4d765d3
parent59282782c4c86731bb437e40bdeef7fb53c718a2 (diff)
QWaylandScreen: Implement subpixelAntialiasingTypeHint
It isn't really used anywhere yet, since on Unix QFontconfigDatabase doesn't use the screen's information. Pick-to: 6.5 Change-Id: Icab81b2bf8df1a23223a74f2d4aee94601e0bea3 Reviewed-by: David Edmundson <davidedmundson@kde.org> (cherry picked from commit 2d1eb5b8eec538458be09d38925fdd2b9d1101a3) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 33c35df1bd6b496ce73ce13b2fb431e2cef1f6f5)
-rw-r--r--src/client/qwaylandscreen.cpp29
-rw-r--r--src/client/qwaylandscreen_p.h3
2 files changed, 30 insertions, 2 deletions
diff --git a/src/client/qwaylandscreen.cpp b/src/client/qwaylandscreen.cpp
index 7c4f1bdf2..5c88f8cbd 100644
--- a/src/client/qwaylandscreen.cpp
+++ b/src/client/qwaylandscreen.cpp
@@ -190,6 +190,32 @@ QPlatformCursor *QWaylandScreen::cursor() const
}
#endif // QT_CONFIG(cursor)
+QPlatformScreen::SubpixelAntialiasingType QWaylandScreen::subpixelAntialiasingTypeHint() const
+{
+ QPlatformScreen::SubpixelAntialiasingType type = QPlatformScreen::subpixelAntialiasingTypeHint();
+ if (type == QPlatformScreen::Subpixel_None) {
+ switch (mSubpixel) {
+ case wl_output::subpixel_unknown:
+ case wl_output::subpixel_none:
+ type = QPlatformScreen::Subpixel_None;
+ break;
+ case wl_output::subpixel_horizontal_rgb:
+ type = QPlatformScreen::Subpixel_RGB;
+ break;
+ case wl_output::subpixel_horizontal_bgr:
+ type = QPlatformScreen::Subpixel_BGR;
+ break;
+ case wl_output::subpixel_vertical_rgb:
+ type = QPlatformScreen::Subpixel_VRGB;
+ break;
+ case wl_output::subpixel_vertical_bgr:
+ type = QPlatformScreen::Subpixel_VBGR;
+ break;
+ }
+ }
+ return type;
+}
+
QWaylandScreen *QWaylandScreen::waylandScreenFromWindow(QWindow *window)
{
QPlatformScreen *platformScreen = QPlatformScreen::platformScreenForWindow(window);
@@ -225,11 +251,10 @@ void QWaylandScreen::output_geometry(int32_t x, int32_t y,
const QString &model,
int32_t transform)
{
- Q_UNUSED(subpixel);
-
mManufacturer = make;
mModel = model;
+ mSubpixel = subpixel;
mTransform = transform;
mPhysicalSize = QSize(width, height);
diff --git a/src/client/qwaylandscreen_p.h b/src/client/qwaylandscreen_p.h
index 4499f0eef..c0f6f199d 100644
--- a/src/client/qwaylandscreen_p.h
+++ b/src/client/qwaylandscreen_p.h
@@ -73,6 +73,8 @@ public:
QPlatformCursor *cursor() const override;
#endif
+ SubpixelAntialiasingType subpixelAntialiasingTypeHint() const override;
+
uint32_t outputId() const { return m_outputId; }
::wl_output *output() const override
{
@@ -117,6 +119,7 @@ protected:
int mScale = 1;
int mDepth = 32;
int mRefreshRate = 60000;
+ int mSubpixel = -1;
int mTransform = -1;
QImage::Format mFormat = QImage::Format_ARGB32_Premultiplied;
QSize mPhysicalSize;