Changeset View
Changeset View
Standalone View
Standalone View
plugins/qpa/sharingplatformcontext.cpp
Show All 14 Lines | |||||
15 | GNU General Public License for more details. | 15 | GNU General Public License for more details. | ||
16 | 16 | | |||
17 | You should have received a copy of the GNU General Public License | 17 | You should have received a copy of the GNU General Public License | ||
18 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 18 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
19 | *********************************************************************/ | 19 | *********************************************************************/ | ||
20 | #include "sharingplatformcontext.h" | 20 | #include "sharingplatformcontext.h" | ||
21 | #include "offscreensurface.h" | 21 | #include "offscreensurface.h" | ||
22 | #include "window.h" | 22 | #include "window.h" | ||
23 | | ||||
24 | #include "../../internal_client.h" | ||||
25 | #include "../../main.h" | ||||
23 | #include "../../platform.h" | 26 | #include "../../platform.h" | ||
24 | #include "../../shell_client.h" | 27 | | ||
25 | #include <logging.h> | 28 | #include <logging.h> | ||
26 | 29 | | |||
27 | #include <QOpenGLFramebufferObject> | 30 | #include <QOpenGLFramebufferObject> | ||
28 | #include <private/qopenglcontext_p.h> | 31 | #include <private/qopenglcontext_p.h> | ||
29 | 32 | | |||
30 | namespace KWin | 33 | namespace KWin | ||
31 | { | 34 | { | ||
32 | 35 | | |||
▲ Show 20 Lines • Show All 44 Lines • ▼ Show 20 Line(s) | |||||
77 | { | 80 | { | ||
78 | return false; | 81 | return false; | ||
79 | } | 82 | } | ||
80 | 83 | | |||
81 | void SharingPlatformContext::swapBuffers(QPlatformSurface *surface) | 84 | void SharingPlatformContext::swapBuffers(QPlatformSurface *surface) | ||
82 | { | 85 | { | ||
83 | if (surface->surface()->surfaceClass() == QSurface::Window) { | 86 | if (surface->surface()->surfaceClass() == QSurface::Window) { | ||
84 | Window *window = static_cast<Window *>(surface); | 87 | Window *window = static_cast<Window *>(surface); | ||
85 | auto c = window->shellClient(); | 88 | InternalClient *client = window->client(); | ||
86 | if (!c) { | 89 | if (!client) { | ||
87 | qCDebug(KWIN_QPA) << "SwapBuffers called but there is no ShellClient"; | | |||
88 | return; | 90 | return; | ||
89 | } | 91 | } | ||
90 | context()->makeCurrent(surface->surface()); | 92 | context()->makeCurrent(surface->surface()); | ||
91 | glFlush(); | 93 | glFlush(); | ||
92 | c->setInternalFramebufferObject(window->swapFBO()); | 94 | client->present(window->swapFBO()); | ||
93 | window->bindContentFBO(); | 95 | window->bindContentFBO(); | ||
94 | } | 96 | } | ||
95 | } | 97 | } | ||
96 | 98 | | |||
97 | GLuint SharingPlatformContext::defaultFramebufferObject(QPlatformSurface *surface) const | 99 | GLuint SharingPlatformContext::defaultFramebufferObject(QPlatformSurface *surface) const | ||
98 | { | 100 | { | ||
99 | if (Window *window = dynamic_cast<Window*>(surface)) { | 101 | if (Window *window = dynamic_cast<Window*>(surface)) { | ||
100 | const auto &fbo = window->contentFBO(); | 102 | const auto &fbo = window->contentFBO(); | ||
Show All 24 Lines |