qeglfsscreen.cpp

Absolute File Name:/home/qt/qt5_coco/qt5/qtbase/src/plugins/platforms/eglfs/qeglfsscreen.cpp
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5QEglFSScreen::QEglFSScreen(EGLDisplay dpy)-
6 : m_dpy(dpy),-
7 m_surface(((EGLSurface)0)),-
8 m_cursor(0)-
9{-
10 m_cursor = qt_egl_device_integration()->createCursor(this);-
11}
never executed: end of block
0
12-
13QEglFSScreen::~QEglFSScreen()-
14{-
15 delete m_cursor;-
16 QOpenGLCompositor::destroy();-
17}
never executed: end of block
0
18-
19QRect QEglFSScreen::geometry() const-
20{-
21 return
never executed: return QRect(QPoint(0, 0), qt_egl_device_integration()->screenSize());
QRect(QPoint(0, 0), qt_egl_device_integration()->screenSize());
never executed: return QRect(QPoint(0, 0), qt_egl_device_integration()->screenSize());
0
22}-
23-
24int QEglFSScreen::depth() const-
25{-
26 return
never executed: return qt_egl_device_integration()->screenDepth();
qt_egl_device_integration()->screenDepth();
never executed: return qt_egl_device_integration()->screenDepth();
0
27}-
28-
29QImage::Format QEglFSScreen::format() const-
30{-
31 return
never executed: return qt_egl_device_integration()->screenFormat();
qt_egl_device_integration()->screenFormat();
never executed: return qt_egl_device_integration()->screenFormat();
0
32}-
33-
34QSizeF QEglFSScreen::physicalSize() const-
35{-
36 return
never executed: return qt_egl_device_integration()->physicalScreenSize();
qt_egl_device_integration()->physicalScreenSize();
never executed: return qt_egl_device_integration()->physicalScreenSize();
0
37}-
38-
39QDpi QEglFSScreen::logicalDpi() const-
40{-
41 return
never executed: return qt_egl_device_integration()->logicalDpi();
qt_egl_device_integration()->logicalDpi();
never executed: return qt_egl_device_integration()->logicalDpi();
0
42}-
43-
44qreal QEglFSScreen::pixelDensity() const-
45{-
46 return
never executed: return qt_egl_device_integration()->pixelDensity();
qt_egl_device_integration()->pixelDensity();
never executed: return qt_egl_device_integration()->pixelDensity();
0
47}-
48-
49Qt::ScreenOrientation QEglFSScreen::nativeOrientation() const-
50{-
51 return
never executed: return qt_egl_device_integration()->nativeOrientation();
qt_egl_device_integration()->nativeOrientation();
never executed: return qt_egl_device_integration()->nativeOrientation();
0
52}-
53-
54Qt::ScreenOrientation QEglFSScreen::orientation() const-
55{-
56 return
never executed: return qt_egl_device_integration()->orientation();
qt_egl_device_integration()->orientation();
never executed: return qt_egl_device_integration()->orientation();
0
57}-
58-
59QPlatformCursor *QEglFSScreen::cursor() const-
60{-
61 return
never executed: return m_cursor;
m_cursor;
never executed: return m_cursor;
0
62}-
63-
64qreal QEglFSScreen::refreshRate() const-
65{-
66 return
never executed: return qt_egl_device_integration()->refreshRate();
qt_egl_device_integration()->refreshRate();
never executed: return qt_egl_device_integration()->refreshRate();
0
67}-
68-
69void QEglFSScreen::setPrimarySurface(EGLSurface surface)-
70{-
71 m_surface = surface;-
72}
never executed: end of block
0
73-
74void QEglFSScreen::handleCursorMove(const QPoint &pos)-
75{-
76 const QOpenGLCompositor *compositor = QOpenGLCompositor::instance();-
77 const QList<QOpenGLCompositorWindow *> windows = compositor->windows();-
78-
79-
80 if (windows.isEmpty()
windows.isEmpty()Description
TRUEnever evaluated
FALSEnever evaluated
)
0
81 return;
never executed: return;
0
82-
83-
84 if (windows.count() == 1
windows.count() == 1Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
85 QWindow *window = windows[0]->sourceWindow();-
86 if (m_pointerWindow != window
m_pointerWindow != windowDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
87 m_pointerWindow = window;-
88 QWindowSystemInterface::handleEnterEvent(window, window->mapFromGlobal(pos), pos);-
89 }
never executed: end of block
0
90 return;
never executed: return;
0
91 }-
92-
93 QWindow *enter = 0, *leave = 0;-
94 for (int i = windows.count() - 1; i >= 0
i >= 0Description
TRUEnever evaluated
FALSEnever evaluated
; --i) {
0
95 QWindow *window = windows[i]->sourceWindow();-
96 const QRect geom = window->geometry();-
97 if (geom.contains(pos)
geom.contains(pos)Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
98 if (m_pointerWindow != window
m_pointerWindow != windowDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
99 leave = m_pointerWindow;-
100 m_pointerWindow = window;-
101 enter = window;-
102 }
never executed: end of block
0
103 break;
never executed: break;
0
104 }-
105 }
never executed: end of block
0
106-
107 if (enter
enterDescription
TRUEnever evaluated
FALSEnever evaluated
&& leave
leaveDescription
TRUEnever evaluated
FALSEnever evaluated
)
0
108 QWindowSystemInterface::handleEnterLeaveEvent(enter, leave, enter->mapFromGlobal(pos), pos);
never executed: QWindowSystemInterface::handleEnterLeaveEvent(enter, leave, enter->mapFromGlobal(pos), pos);
0
109}
never executed: end of block
0
110-
111QPixmap QEglFSScreen::grabWindow(WId wid, int x, int y, int width, int height) const-
112{-
113 QOpenGLCompositor *compositor = QOpenGLCompositor::instance();-
114 const QList<QOpenGLCompositorWindow *> windows = compositor->windows();-
115 ((!(!windows.isEmpty())) ? qt_assert("!windows.isEmpty()",__FILE__,162) : qt_noop());-
116-
117 QImage img;-
118-
119 if (static_cast<
static_cast<QE...))->isRaster()Description
TRUEnever evaluated
FALSEnever evaluated
QEglFSWindow *>(windows.first()->sourceWindow()->handle())->isRaster()
static_cast<QE...))->isRaster()Description
TRUEnever evaluated
FALSEnever evaluated
) {
0
120-
121-
122-
123 img = compositor->grab();-
124 }
never executed: end of block
else {
0
125-
126-
127-
128-
129 QMessageLogger(__FILE__, 176, __PRETTY_FUNCTION__).warning("grabWindow: Not supported for non-composited OpenGL content. Use QQuickWindow::grabWindow() instead.");-
130 return
never executed: return QPixmap();
QPixmap();
never executed: return QPixmap();
0
131 }-
132-
133 if (!wid
!widDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
134 const QSize screenSize = geometry().size();-
135 if (width < 0
width < 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
136 width = screenSize.width() - x;
never executed: width = screenSize.width() - x;
0
137 if (height < 0
height < 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
138 height = screenSize.height() - y;
never executed: height = screenSize.height() - y;
0
139 return
never executed: return QPixmap::fromImage(img).copy(x, y, width, height);
QPixmap::fromImage(img).copy(x, y, width, height);
never executed: return QPixmap::fromImage(img).copy(x, y, width, height);
0
140 }-
141-
142 for (QForeachContainer<typename QtPrivate::remove_reference<decltype(windows)>::type> _container_((windows)); _container_.control && _container_.i != _container_.e; ++_container_.i, _container_.control ^= 1) for (QOpenGLCompositorWindow *w = *_container_.i; _container_.control; _container_.control = 0) {-
143 const QWindow *window = w->sourceWindow();-
144 if (window->winId() == wid
window->winId() == widDescription
TRUEnever evaluated
FALSEnever evaluated
) {
0
145 const QRect geom = window->geometry();-
146 if (width < 0
width < 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
147 width = geom.width() - x;
never executed: width = geom.width() - x;
0
148 if (height < 0
height < 0Description
TRUEnever evaluated
FALSEnever evaluated
)
0
149 height = geom.height() - y;
never executed: height = geom.height() - y;
0
150 QRect rect(geom.topLeft() + QPoint(x, y), QSize(width, height));-
151 rect &= window->geometry();-
152 return
never executed: return QPixmap::fromImage(img).copy(rect);
QPixmap::fromImage(img).copy(rect);
never executed: return QPixmap::fromImage(img).copy(rect);
0
153 }-
154 }
never executed: end of block
0
155-
156 return
never executed: return QPixmap();
QPixmap();
never executed: return QPixmap();
0
157}-
158-
159-
Switch to Source codePreprocessed file

Generated by Squish Coco Non-Commercial 4.3.0-BETA-master-30-08-2018-4cb69e9