Paste P305

Masterwork From Distant Lands
ActivePublic

Authored by davidedmundson on Feb 6 2019, 9:58 PM.
commit 7957ed41b88518c77f6f41f50654d4954a98c5db
Author: David Edmundson <kde@davidedmundson.co.uk>
Date: Sun Feb 3 18:36:28 2019 +0000
scale
diff --git a/plugins/platforms/hwcomposer/egl_hwcomposer_backend.cpp b/plugins/platforms/hwcomposer/egl_hwcomposer_backend.cpp
index 3c96db118..7d8d55c82 100644
--- a/plugins/platforms/hwcomposer/egl_hwcomposer_backend.cpp
+++ b/plugins/platforms/hwcomposer/egl_hwcomposer_backend.cpp
@@ -130,6 +130,10 @@ bool EglHwcomposerBackend::makeContextCurrent()
qCWarning(KWIN_HWCOMPOSER) << "Error occurred while creating context " << error;
return false;
}
+
+ QSize overall = m_backend->size();
+ glViewport(0, 0, overall.width(), overall.height());
+
return true;
}
diff --git a/plugins/platforms/hwcomposer/hwcomposer_backend.cpp b/plugins/platforms/hwcomposer/hwcomposer_backend.cpp
index 30971757d..447504cb2 100644
--- a/plugins/platforms/hwcomposer/hwcomposer_backend.cpp
+++ b/plugins/platforms/hwcomposer/hwcomposer_backend.cpp
@@ -250,7 +250,7 @@ void HwcomposerBackend::init()
setReady(true);
}
-QSize HwcomposerBackend::screenSize() const
+QSize HwcomposerBackend::size() const
{
if (m_output) {
return m_output->pixelSize();
@@ -258,6 +258,22 @@ QSize HwcomposerBackend::screenSize() const
return QSize();
}
+QSize HwcomposerBackend::screenSize() const
+{
+ if (m_output) {
+ return m_output->pixelSize() / m_output->scale();
+ }
+ return QSize();
+}
+
+int HwcomposerBackend::scale() const
+ {
+ if (m_output) {
+ return m_output->scale();
+ }
+ return 1;
+}
+
void HwcomposerBackend::initLights()
{
hw_module_t *lightsModule = nullptr;
@@ -508,6 +524,7 @@ HwcomposerOutput::HwcomposerOutput(hwc_composer_device_1_t *device):
initWaylandOutputDevice(QString(), QString(), QByteArray(), {mode});
setInternal(true);
setEnabled(true);
+ setScale(3);
setWaylandMode(m_pixelSize, mode.refreshRate);
}
diff --git a/plugins/platforms/hwcomposer/hwcomposer_backend.h b/plugins/platforms/hwcomposer/hwcomposer_backend.h
index 5c6085df1..c660070f3 100644
--- a/plugins/platforms/hwcomposer/hwcomposer_backend.h
+++ b/plugins/platforms/hwcomposer/hwcomposer_backend.h
@@ -75,11 +75,11 @@ public:
Outputs outputs() const override;
Outputs enabledOutputs() const override;
- QSize size() const {
- return screenSize();
- }
+ QSize size() const;
QSize screenSize() const override;
+ int scale() const;
+
HwcomposerWindow *createSurface();
hwc_composer_device_1_t *device() const {
davidedmundson edited the content of this paste. (Show Details)Feb 6 2019, 9:58 PM
davidedmundson changed the title of this paste from untitled to Masterwork From Distant Lands.