Merge lp:~gerboland/qtubuntu/rasterGLSurface-fixes into lp:qtubuntu
- rasterGLSurface-fixes
- Merge into trunk
Proposed by
Gerry Boland
Status: | Superseded |
---|---|
Proposed branch: | lp:~gerboland/qtubuntu/rasterGLSurface-fixes |
Merge into: | lp:qtubuntu |
Diff against target: |
554 lines (+224/-32) 16 files modified
debian/control (+1/-0) src/ubuntumirclient/backingstore.cpp (+10/-2) src/ubuntumirclient/backingstore.h (+1/-0) src/ubuntumirclient/debugextension.cpp (+55/-0) src/ubuntumirclient/debugextension.h (+39/-0) src/ubuntumirclient/desktopwindow.cpp (+26/-0) src/ubuntumirclient/desktopwindow.h (+29/-0) src/ubuntumirclient/glcontext.cpp (+0/-2) src/ubuntumirclient/integration.cpp (+30/-11) src/ubuntumirclient/integration.h (+4/-1) src/ubuntumirclient/logging.h (+1/-0) src/ubuntumirclient/plugin.cpp (+5/-11) src/ubuntumirclient/plugin.h (+2/-3) src/ubuntumirclient/ubuntumirclient.pro (+4/-0) src/ubuntumirclient/window.cpp (+13/-1) src/ubuntumirclient/window.h (+4/-1) |
To merge this branch: | bzr merge lp:~gerboland/qtubuntu/rasterGLSurface-fixes |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Ubuntu Phablet Team | Pending | ||
Review via email:
|
This proposal has been superseded by a proposal from 2016-10-13.
Commit message
Small BackingStore fixes: call makeCurrent on texture changes, and choose correct QImage format to avoid bit swizzling
Description of the change
To post a comment you must log in.
Unmerged revisions
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'debian/control' |
2 | --- debian/control 2016-08-24 12:40:30 +0000 |
3 | +++ debian/control 2016-10-13 11:25:46 +0000 |
4 | @@ -11,6 +11,7 @@ |
5 | libglib2.0-dev, |
6 | libinput-dev, |
7 | libmirclient-dev (>= 0.13.0), |
8 | + libmirclient-debug-extension-dev, |
9 | libmtdev-dev, |
10 | libubuntu-application-api-dev (>= 2.9.0), |
11 | libudev-dev, |
12 | |
13 | === modified file 'src/ubuntumirclient/backingstore.cpp' |
14 | --- src/ubuntumirclient/backingstore.cpp 2016-04-20 16:10:06 +0000 |
15 | +++ src/ubuntumirclient/backingstore.cpp 2016-10-13 11:25:46 +0000 |
16 | @@ -37,6 +37,7 @@ |
17 | |
18 | UbuntuBackingStore::~UbuntuBackingStore() |
19 | { |
20 | + mContext->makeCurrent(window()); // needed as QOpenGLTexture destructor assumes current context |
21 | } |
22 | |
23 | void UbuntuBackingStore::flush(QWindow* window, const QRegion& region, const QPoint& offset) |
24 | @@ -52,7 +53,6 @@ |
25 | mBlitter->create(); |
26 | |
27 | mBlitter->bind(); |
28 | - mBlitter->setSwizzleRB(true); |
29 | mBlitter->blit(mTexture->textureId(), QMatrix4x4(), QOpenGLTextureBlitter::OriginTopLeft); |
30 | mBlitter->release(); |
31 | |
32 | @@ -115,7 +115,9 @@ |
33 | |
34 | void UbuntuBackingStore::resize(const QSize& size, const QRegion& /*staticContents*/) |
35 | { |
36 | - mImage = QImage(size, QImage::Format_RGB32); |
37 | + mImage = QImage(size, QImage::Format_RGBA8888); |
38 | + |
39 | + mContext->makeCurrent(window()); |
40 | |
41 | if (mTexture->isCreated()) |
42 | mTexture->destroy(); |
43 | @@ -125,3 +127,9 @@ |
44 | { |
45 | return &mImage; |
46 | } |
47 | + |
48 | +QImage UbuntuBackingStore::toImage() const |
49 | +{ |
50 | + // used by QPlatformBackingStore::composeAndFlush |
51 | + return mImage; |
52 | +} |
53 | |
54 | === modified file 'src/ubuntumirclient/backingstore.h' |
55 | --- src/ubuntumirclient/backingstore.h 2014-11-11 14:34:12 +0000 |
56 | +++ src/ubuntumirclient/backingstore.h 2016-10-13 11:25:46 +0000 |
57 | @@ -34,6 +34,7 @@ |
58 | void flush(QWindow* window, const QRegion& region, const QPoint& offset) override; |
59 | void resize(const QSize& size, const QRegion& staticContents) override; |
60 | QPaintDevice* paintDevice() override; |
61 | + QImage toImage() const override; |
62 | |
63 | protected: |
64 | void updateTexture(); |
65 | |
66 | === added file 'src/ubuntumirclient/debugextension.cpp' |
67 | --- src/ubuntumirclient/debugextension.cpp 1970-01-01 00:00:00 +0000 |
68 | +++ src/ubuntumirclient/debugextension.cpp 2016-10-13 11:25:46 +0000 |
69 | @@ -0,0 +1,55 @@ |
70 | +/* |
71 | + * Copyright (C) 2016 Canonical, Ltd. |
72 | + * |
73 | + * This program is free software: you can redistribute it and/or modify it under |
74 | + * the terms of the GNU Lesser General Public License version 3, as published by |
75 | + * the Free Software Foundation. |
76 | + * |
77 | + * This program is distributed in the hope that it will be useful, but WITHOUT |
78 | + * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY, |
79 | + * SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
80 | + * Lesser General Public License for more details. |
81 | + * |
82 | + * You should have received a copy of the GNU Lesser General Public License |
83 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
84 | + */ |
85 | + |
86 | +#include "debugextension.h" |
87 | + |
88 | +#include "logging.h" |
89 | + |
90 | +// mir client debug |
91 | +#include <mir_toolkit/debug/surface.h> |
92 | + |
93 | +Q_LOGGING_CATEGORY(ubuntumirclientDebug, "ubuntumirclient.debug") |
94 | + |
95 | +UbuntuDebugExtension::UbuntuDebugExtension() |
96 | + : m_mirclientDebug(QStringLiteral("mirclient-debug-extension"), 1) |
97 | + , m_mapper(nullptr) |
98 | +{ |
99 | + qCDebug(ubuntumirclientDebug) << "NOTICE: Loading mirclient-debug-extension"; |
100 | + m_mapper = (MapperPrototype) m_mirclientDebug.resolve("mir_debug_surface_coords_to_screen"); |
101 | + |
102 | + if (!m_mirclientDebug.isLoaded()) { |
103 | + qCWarning(ubuntumirclientDebug) << "ERROR: mirclient-debug-extension failed to load:" |
104 | + << m_mirclientDebug.errorString(); |
105 | + } else if (!m_mapper) { |
106 | + qCWarning(ubuntumirclientDebug) << "ERROR: unable to find required symbols in mirclient-debug-extension:" |
107 | + << m_mirclientDebug.errorString(); |
108 | + } |
109 | +} |
110 | + |
111 | +QPoint UbuntuDebugExtension::mapSurfacePointToScreen(MirSurface *surface, const QPoint &point) |
112 | +{ |
113 | + if (!m_mapper) { |
114 | + return point; |
115 | + } |
116 | + |
117 | + QPoint mappedPoint; |
118 | + bool status = m_mapper(surface, point.x(), point.y(), &mappedPoint.rx(), &mappedPoint.ry()); |
119 | + if (status) { |
120 | + return mappedPoint; |
121 | + } else { |
122 | + return point; |
123 | + } |
124 | +} |
125 | |
126 | === added file 'src/ubuntumirclient/debugextension.h' |
127 | --- src/ubuntumirclient/debugextension.h 1970-01-01 00:00:00 +0000 |
128 | +++ src/ubuntumirclient/debugextension.h 2016-10-13 11:25:46 +0000 |
129 | @@ -0,0 +1,39 @@ |
130 | +/* |
131 | + * Copyright (C) 2016 Canonical, Ltd. |
132 | + * |
133 | + * This program is free software: you can redistribute it and/or modify it under |
134 | + * the terms of the GNU Lesser General Public License version 3, as published by |
135 | + * the Free Software Foundation. |
136 | + * |
137 | + * This program is distributed in the hope that it will be useful, but WITHOUT |
138 | + * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY, |
139 | + * SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
140 | + * Lesser General Public License for more details. |
141 | + * |
142 | + * You should have received a copy of the GNU Lesser General Public License |
143 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
144 | + */ |
145 | + |
146 | +#ifndef UBUNTU_DEBUG_EXTENSION_H |
147 | +#define UBUNTU_DEBUG_EXTENSION_H |
148 | + |
149 | +#include <QPoint> |
150 | +#include <QLibrary> |
151 | +struct MirSurface; |
152 | + |
153 | +typedef bool (*MapperPrototype)(MirSurface* surface, int x, int y, int* screenX, int* screenY); |
154 | + |
155 | + |
156 | +class UbuntuDebugExtension |
157 | +{ |
158 | +public: |
159 | + UbuntuDebugExtension(); |
160 | + |
161 | + QPoint mapSurfacePointToScreen(MirSurface *, const QPoint &point); |
162 | + |
163 | +private: |
164 | + QLibrary m_mirclientDebug; |
165 | + MapperPrototype m_mapper; |
166 | +}; |
167 | + |
168 | +#endif // UBUNTU_DEBUG_EXTENSION_H |
169 | |
170 | === added file 'src/ubuntumirclient/desktopwindow.cpp' |
171 | --- src/ubuntumirclient/desktopwindow.cpp 1970-01-01 00:00:00 +0000 |
172 | +++ src/ubuntumirclient/desktopwindow.cpp 2016-10-13 11:25:46 +0000 |
173 | @@ -0,0 +1,26 @@ |
174 | +/* |
175 | + * Copyright (C) 2016 Canonical, Ltd. |
176 | + * |
177 | + * This program is free software: you can redistribute it and/or modify it under |
178 | + * the terms of the GNU Lesser General Public License version 3, as published by |
179 | + * the Free Software Foundation. |
180 | + * |
181 | + * This program is distributed in the hope that it will be useful, but WITHOUT |
182 | + * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY, |
183 | + * SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
184 | + * Lesser General Public License for more details. |
185 | + * |
186 | + * You should have received a copy of the GNU Lesser General Public License |
187 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
188 | + */ |
189 | + |
190 | +#include "desktopwindow.h" |
191 | + |
192 | +// local |
193 | +#include "logging.h" |
194 | + |
195 | +UbuntuDesktopWindow::UbuntuDesktopWindow(QWindow *window) |
196 | + : QPlatformWindow(window) |
197 | +{ |
198 | + qCDebug(ubuntumirclient, "UbuntuDesktopWindow(window=%p)", window); |
199 | +} |
200 | |
201 | === added file 'src/ubuntumirclient/desktopwindow.h' |
202 | --- src/ubuntumirclient/desktopwindow.h 1970-01-01 00:00:00 +0000 |
203 | +++ src/ubuntumirclient/desktopwindow.h 2016-10-13 11:25:46 +0000 |
204 | @@ -0,0 +1,29 @@ |
205 | +/* |
206 | + * Copyright (C) 2016 Canonical, Ltd. |
207 | + * |
208 | + * This program is free software: you can redistribute it and/or modify it under |
209 | + * the terms of the GNU Lesser General Public License version 3, as published by |
210 | + * the Free Software Foundation. |
211 | + * |
212 | + * This program is distributed in the hope that it will be useful, but WITHOUT |
213 | + * ANY WARRANTY; without even the implied warranties of MERCHANTABILITY, |
214 | + * SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
215 | + * Lesser General Public License for more details. |
216 | + * |
217 | + * You should have received a copy of the GNU Lesser General Public License |
218 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
219 | + */ |
220 | + |
221 | +#ifndef UBUNTU_DESKTOP_WINDOW_H |
222 | +#define UBUNTU_DESKTOP_WINDOW_H |
223 | + |
224 | +#include <qpa/qplatformwindow.h> |
225 | + |
226 | +// TODO Implement it. For now it's just an empty, dummy class. |
227 | +class UbuntuDesktopWindow : public QPlatformWindow |
228 | +{ |
229 | +public: |
230 | + UbuntuDesktopWindow(QWindow*); |
231 | +}; |
232 | + |
233 | +#endif // UBUNTU_DESKTOP_WINDOW_H |
234 | |
235 | === modified file 'src/ubuntumirclient/glcontext.cpp' |
236 | --- src/ubuntumirclient/glcontext.cpp 2016-08-17 15:32:38 +0000 |
237 | +++ src/ubuntumirclient/glcontext.cpp 2016-10-13 11:25:46 +0000 |
238 | @@ -74,8 +74,6 @@ |
239 | |
240 | bool UbuntuOpenGLContext::makeCurrent(QPlatformSurface* surface) |
241 | { |
242 | - Q_ASSERT(surface->surface()->surfaceType() == QSurface::OpenGLSurface); |
243 | - |
244 | const bool ret = QEGLPlatformContext::makeCurrent(surface); |
245 | |
246 | if (Q_LIKELY(ret)) { |
247 | |
248 | === modified file 'src/ubuntumirclient/integration.cpp' |
249 | --- src/ubuntumirclient/integration.cpp 2016-09-28 10:51:25 +0000 |
250 | +++ src/ubuntumirclient/integration.cpp 2016-10-13 11:25:46 +0000 |
251 | @@ -18,6 +18,8 @@ |
252 | #include "integration.h" |
253 | #include "backingstore.h" |
254 | #include "clipboard.h" |
255 | +#include "desktopwindow.h" |
256 | +#include "debugextension.h" |
257 | #include "glcontext.h" |
258 | #include "input.h" |
259 | #include "logging.h" |
260 | @@ -29,6 +31,7 @@ |
261 | // Qt |
262 | #include <QFileInfo> |
263 | #include <QGuiApplication> |
264 | +#include <private/qeglpbuffer_p.h> |
265 | #include <qpa/qplatformnativeinterface.h> |
266 | #include <qpa/qplatforminputcontextfactory_p.h> |
267 | #include <qpa/qplatforminputcontext.h> |
268 | @@ -70,7 +73,8 @@ |
269 | QWindowSystemInterface::handleApplicationStateChanged(Qt::ApplicationSuspended); |
270 | } |
271 | |
272 | -UbuntuClientIntegration::UbuntuClientIntegration() |
273 | + |
274 | +UbuntuClientIntegration::UbuntuClientIntegration(int argc, char **argv) |
275 | : QPlatformIntegration() |
276 | , mNativeInterface(new UbuntuNativeInterface(this)) |
277 | , mFontDb(new QGenericUnixFontDatabase) |
278 | @@ -105,6 +109,17 @@ |
279 | mEglNativeDisplay = mir_connection_get_egl_native_display(mMirConnection); |
280 | ASSERT((mEglDisplay = eglGetDisplay(mEglNativeDisplay)) != EGL_NO_DISPLAY); |
281 | ASSERT(eglInitialize(mEglDisplay, nullptr, nullptr) == EGL_TRUE); |
282 | + |
283 | + // Has debug mode been requsted, either with "-testability" switch or QT_LOAD_TESTABILITY env var |
284 | + bool testability = qEnvironmentVariableIsSet("QT_LOAD_TESTABILITY"); |
285 | + for (int i=1; !testability && i<argc; i++) { |
286 | + if (strcmp(argv[i], "-testability") == 0) { |
287 | + testability = true; |
288 | + } |
289 | + } |
290 | + if (testability) { |
291 | + mDebugExtension.reset(new UbuntuDebugExtension); |
292 | + } |
293 | } |
294 | |
295 | void UbuntuClientIntegration::initialize() |
296 | @@ -211,21 +226,17 @@ |
297 | |
298 | QPlatformWindow* UbuntuClientIntegration::createPlatformWindow(QWindow* window) const |
299 | { |
300 | - return new UbuntuWindow(window, mInput, mNativeInterface, mEglDisplay, mMirConnection); |
301 | + if (window->type() == Qt::Desktop) { |
302 | + // Desktop windows should not be backed up by a mir surface as they don't draw anything (nor should). |
303 | + return new UbuntuDesktopWindow(window); |
304 | + } else { |
305 | + return new UbuntuWindow(window, mInput, mNativeInterface, mEglDisplay, mMirConnection, mDebugExtension.data()); |
306 | + } |
307 | } |
308 | |
309 | bool UbuntuClientIntegration::hasCapability(QPlatformIntegration::Capability cap) const |
310 | { |
311 | switch (cap) { |
312 | - case ThreadedPixmaps: |
313 | - return true; |
314 | - |
315 | - case OpenGL: |
316 | - return true; |
317 | - |
318 | - case ApplicationState: |
319 | - return true; |
320 | - |
321 | case ThreadedOpenGL: |
322 | if (qEnvironmentVariableIsEmpty("QTUBUNTU_NO_THREADED_OPENGL")) { |
323 | return true; |
324 | @@ -233,8 +244,16 @@ |
325 | qCDebug(ubuntumirclient, "disabled threaded OpenGL"); |
326 | return false; |
327 | } |
328 | + |
329 | + case ThreadedPixmaps: |
330 | + case OpenGL: |
331 | + case ApplicationState: |
332 | case MultipleWindows: |
333 | case NonFullScreenWindows: |
334 | +#if QT_VERSION > QT_VERSION_CHECK(5, 5, 0) |
335 | + case SwitchableWidgetComposition: |
336 | +#endif |
337 | + case RasterGLSurface: // needed for QQuickWidget |
338 | return true; |
339 | default: |
340 | return QPlatformIntegration::hasCapability(cap); |
341 | |
342 | === modified file 'src/ubuntumirclient/integration.h' |
343 | --- src/ubuntumirclient/integration.h 2016-08-24 12:40:30 +0000 |
344 | +++ src/ubuntumirclient/integration.h 2016-10-13 11:25:46 +0000 |
345 | @@ -29,6 +29,7 @@ |
346 | |
347 | #include <EGL/egl.h> |
348 | |
349 | +class UbuntuDebugExtension; |
350 | class UbuntuInput; |
351 | class UbuntuNativeInterface; |
352 | class UbuntuScreen; |
353 | @@ -39,7 +40,7 @@ |
354 | Q_OBJECT |
355 | |
356 | public: |
357 | - UbuntuClientIntegration(); |
358 | + UbuntuClientIntegration(int argc, char **argv); |
359 | virtual ~UbuntuClientIntegration(); |
360 | |
361 | // QPlatformIntegration methods. |
362 | @@ -64,6 +65,7 @@ |
363 | EGLDisplay eglDisplay() const { return mEglDisplay; } |
364 | EGLNativeDisplayType eglNativeDisplay() const { return mEglNativeDisplay; } |
365 | UbuntuScreenObserver *screenObserver() const { return mScreenObserver.data(); } |
366 | + UbuntuDebugExtension *debugExtension() const { return mDebugExtension.data(); } |
367 | |
368 | private Q_SLOTS: |
369 | void destroyScreen(UbuntuScreen *screen); |
370 | @@ -81,6 +83,7 @@ |
371 | |
372 | UbuntuInput* mInput; |
373 | QPlatformInputContext* mInputContext; |
374 | + QScopedPointer<UbuntuDebugExtension> mDebugExtension; |
375 | QScopedPointer<UbuntuScreenObserver> mScreenObserver; |
376 | qreal mScaleFactor; |
377 | |
378 | |
379 | === modified file 'src/ubuntumirclient/logging.h' |
380 | --- src/ubuntumirclient/logging.h 2016-06-22 17:16:33 +0000 |
381 | +++ src/ubuntumirclient/logging.h 2016-10-13 11:25:46 +0000 |
382 | @@ -26,5 +26,6 @@ |
383 | Q_DECLARE_LOGGING_CATEGORY(ubuntumirclientInput) |
384 | Q_DECLARE_LOGGING_CATEGORY(ubuntumirclientGraphics) |
385 | Q_DECLARE_LOGGING_CATEGORY(ubuntumirclientCursor) |
386 | +Q_DECLARE_LOGGING_CATEGORY(ubuntumirclientDebug) |
387 | |
388 | #endif // QUBUNTULOGGING_H |
389 | |
390 | === modified file 'src/ubuntumirclient/plugin.cpp' |
391 | --- src/ubuntumirclient/plugin.cpp 2015-12-04 16:19:33 +0000 |
392 | +++ src/ubuntumirclient/plugin.cpp 2016-10-13 11:25:46 +0000 |
393 | @@ -1,5 +1,5 @@ |
394 | /* |
395 | - * Copyright (C) 2014 Canonical, Ltd. |
396 | + * Copyright (C) 2014-2016 Canonical, Ltd. |
397 | * |
398 | * This program is free software: you can redistribute it and/or modify it under |
399 | * the terms of the GNU Lesser General Public License version 3, as published by |
400 | @@ -20,15 +20,9 @@ |
401 | |
402 | Q_LOGGING_CATEGORY(ubuntumirclient, "ubuntumirclient", QtWarningMsg) |
403 | |
404 | -QStringList UbuntuMirClientIntegrationPlugin::keys() const |
405 | -{ |
406 | - QStringList list; |
407 | - list << QStringLiteral("ubuntumirclient"); |
408 | - return list; |
409 | -} |
410 | - |
411 | -QPlatformIntegration* UbuntuMirClientIntegrationPlugin::create(const QString &system, |
412 | - const QStringList &) |
413 | +QPlatformIntegration *UbuntuMirClientIntegrationPlugin::create(const QString &system, |
414 | + const QStringList &/*paramList*/, |
415 | + int &argc, char **argv) |
416 | { |
417 | if (system.toLower() == QLatin1String("ubuntumirclient")) { |
418 | #ifdef PLATFORM_API_TOUCH |
419 | @@ -36,7 +30,7 @@ |
420 | #else |
421 | setenv("UBUNTU_PLATFORM_API_BACKEND", "desktop_mirclient", 1); |
422 | #endif |
423 | - return new UbuntuClientIntegration; |
424 | + return new UbuntuClientIntegration(argc, argv); |
425 | } else { |
426 | return 0; |
427 | } |
428 | |
429 | === modified file 'src/ubuntumirclient/plugin.h' |
430 | --- src/ubuntumirclient/plugin.h 2014-06-18 23:10:00 +0000 |
431 | +++ src/ubuntumirclient/plugin.h 2016-10-13 11:25:46 +0000 |
432 | @@ -1,5 +1,5 @@ |
433 | /* |
434 | - * Copyright (C) 2014 Canonical, Ltd. |
435 | + * Copyright (C) 2014-2016 Canonical, Ltd. |
436 | * |
437 | * This program is free software: you can redistribute it and/or modify it under |
438 | * the terms of the GNU Lesser General Public License version 3, as published by |
439 | @@ -25,8 +25,7 @@ |
440 | Q_PLUGIN_METADATA(IID QPlatformIntegrationFactoryInterface_iid FILE "ubuntumirclient.json") |
441 | |
442 | public: |
443 | - QStringList keys() const; |
444 | - QPlatformIntegration* create(const QString&, const QStringList&); |
445 | + QPlatformIntegration *create(const QString &system, const QStringList ¶mList, int &argc, char **argv) override; |
446 | }; |
447 | |
448 | #endif // UBUNTU_CLIENT_PLUGIN_H |
449 | |
450 | === modified file 'src/ubuntumirclient/ubuntumirclient.pro' |
451 | --- src/ubuntumirclient/ubuntumirclient.pro 2016-09-28 10:51:25 +0000 |
452 | +++ src/ubuntumirclient/ubuntumirclient.pro 2016-10-13 11:25:46 +0000 |
453 | @@ -18,6 +18,8 @@ |
454 | backingstore.cpp \ |
455 | clipboard.cpp \ |
456 | cursor.cpp \ |
457 | + debugextension.cpp \ |
458 | + desktopwindow.cpp \ |
459 | glcontext.cpp \ |
460 | input.cpp \ |
461 | integration.cpp \ |
462 | @@ -33,6 +35,8 @@ |
463 | backingstore.h \ |
464 | clipboard.h \ |
465 | cursor.h \ |
466 | + debugextension.h \ |
467 | + desktopwindow.h \ |
468 | glcontext.h \ |
469 | input.h \ |
470 | integration.h \ |
471 | |
472 | === modified file 'src/ubuntumirclient/window.cpp' |
473 | --- src/ubuntumirclient/window.cpp 2016-09-28 10:33:40 +0000 |
474 | +++ src/ubuntumirclient/window.cpp 2016-10-13 11:25:46 +0000 |
475 | @@ -16,8 +16,10 @@ |
476 | |
477 | // Local |
478 | #include "window.h" |
479 | +#include "debugextension.h" |
480 | #include "nativeinterface.h" |
481 | #include "input.h" |
482 | +#include "integration.h" |
483 | #include "screen.h" |
484 | #include "logging.h" |
485 | |
486 | @@ -600,13 +602,14 @@ |
487 | } |
488 | |
489 | UbuntuWindow::UbuntuWindow(QWindow *w, UbuntuInput *input, UbuntuNativeInterface *native, |
490 | - EGLDisplay eglDisplay, MirConnection *mirConnection) |
491 | + EGLDisplay eglDisplay, MirConnection *mirConnection, UbuntuDebugExtension *debugExt) |
492 | : QObject(nullptr) |
493 | , QPlatformWindow(w) |
494 | , mId(makeId()) |
495 | , mWindowState(w->windowState()) |
496 | , mWindowFlags(w->flags()) |
497 | , mWindowVisible(false) |
498 | + , mDebugExtention(debugExt) |
499 | , mNativeInterface(native) |
500 | , mSurface(new UbuntuSurface{this, eglDisplay, input, mirConnection}) |
501 | , mScale(1.0) |
502 | @@ -819,6 +822,15 @@ |
503 | return mSurface->format(); |
504 | } |
505 | |
506 | +QPoint UbuntuWindow::mapToGlobal(const QPoint &pos) const |
507 | +{ |
508 | + if (mDebugExtention) { |
509 | + return mDebugExtention->mapSurfacePointToScreen(mSurface->mirSurface(), pos); |
510 | + } else { |
511 | + return pos; |
512 | + } |
513 | +} |
514 | + |
515 | void* UbuntuWindow::eglSurface() const |
516 | { |
517 | return mSurface->eglSurface(); |
518 | |
519 | === modified file 'src/ubuntumirclient/window.h' |
520 | --- src/ubuntumirclient/window.h 2016-09-21 10:25:33 +0000 |
521 | +++ src/ubuntumirclient/window.h 2016-10-13 11:25:46 +0000 |
522 | @@ -27,6 +27,7 @@ |
523 | |
524 | #include <EGL/egl.h> |
525 | |
526 | +class UbuntuDebugExtension; |
527 | class UbuntuNativeInterface; |
528 | class UbuntuInput; |
529 | class UbuntuScreen; |
530 | @@ -39,7 +40,7 @@ |
531 | Q_OBJECT |
532 | public: |
533 | UbuntuWindow(QWindow *w, UbuntuInput *input, UbuntuNativeInterface* native, EGLDisplay eglDisplay, |
534 | - MirConnection *mirConnection); |
535 | + MirConnection *mirConnection, UbuntuDebugExtension *debugExt); |
536 | virtual ~UbuntuWindow(); |
537 | |
538 | // QPlatformWindow methods. |
539 | @@ -52,6 +53,7 @@ |
540 | void propagateSizeHints() override; |
541 | bool isExposed() const override; |
542 | |
543 | + QPoint mapToGlobal(const QPoint &pos) const override; |
544 | QSurfaceFormat format() const override; |
545 | |
546 | // Additional Window properties exposed by NativeInterface |
547 | @@ -79,6 +81,7 @@ |
548 | Qt::WindowFlags mWindowFlags; |
549 | bool mWindowVisible; |
550 | bool mWindowExposed; |
551 | + UbuntuDebugExtension *mDebugExtention; |
552 | UbuntuNativeInterface *mNativeInterface; |
553 | std::unique_ptr<UbuntuSurface> mSurface; |
554 | float mScale; |