MythTV
master
mythtv
libs
libmythui
mythpaintergpu.cpp
Go to the documentation of this file.
1
#include <QtGlobal>
2
#include <QWindow>
3
4
// MythTV
5
#include "
libmythbase/mythlogging.h
"
6
#include "
mythdisplay.h
"
7
#include "
mythmainwindow.h
"
8
#include "
mythpaintergpu.h
"
9
10
MythPainterGPU::MythPainterGPU
(
MythMainWindow
* Parent)
11
: m_parent(Parent)
12
{
13
MythDisplay
* display =
m_parent
->
GetDisplay
();
14
15
DisplayChanged
();
16
connect(display, &
MythDisplay::DisplayChanged
,
this
,
17
&
MythPainterGPU::DisplayChanged
);
18
}
19
20
void
MythPainterGPU::SetViewControl
(ViewControls Control)
21
{
22
m_viewControl
= Control;
23
}
24
25
void
MythPainterGPU::DisplayChanged
()
26
{
27
MythDisplay
* display =
m_parent
->
GetDisplay
();
28
QScreen *screen = display->
GetCurrentScreen
();
29
QWindow *window = display->
GetCurrentWindow
();
30
31
m_pixelRatio
= window ? window->devicePixelRatio() : screen->devicePixelRatio();
32
m_usingHighDPI
= !qFuzzyCompare(
m_pixelRatio
, 1.0);
33
}
MythDisplay
Definition:
mythdisplay.h:23
MythDisplay::GetCurrentWindow
QWindow * GetCurrentWindow()
Definition:
mythdisplay.cpp:344
MythDisplay::GetCurrentScreen
QScreen * GetCurrentScreen()
Return a pointer to the screen to use.
Definition:
mythdisplay.cpp:339
MythDisplay::DisplayChanged
void DisplayChanged()
MythMainWindow
Definition:
mythmainwindow.h:29
MythMainWindow::GetDisplay
MythDisplay * GetDisplay()
Definition:
mythmainwindow.cpp:257
MythPainterGPU::SetViewControl
void SetViewControl(ViewControls Control)
Definition:
mythpaintergpu.cpp:20
MythPainterGPU::MythPainterGPU
MythPainterGPU(MythMainWindow *Parent)
Definition:
mythpaintergpu.cpp:10
MythPainterGPU::m_usingHighDPI
bool m_usingHighDPI
Definition:
mythpaintergpu.h:36
MythPainterGPU::m_parent
MythMainWindow * m_parent
Definition:
mythpaintergpu.h:33
MythPainterGPU::m_viewControl
ViewControls m_viewControl
Definition:
mythpaintergpu.h:34
MythPainterGPU::DisplayChanged
void DisplayChanged()
Definition:
mythpaintergpu.cpp:25
MythPainterGPU::m_pixelRatio
qreal m_pixelRatio
Definition:
mythpaintergpu.h:35
mythdisplay.h
mythlogging.h
mythmainwindow.h
mythpaintergpu.h
Generated on Thu Apr 16 2026 03:16:21 for MythTV by
1.9.4