Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qqnxglcontext.cpp
Go to the documentation of this file.
1// Copyright (C) 2011 - 2013 BlackBerry Limited. All rights reserved.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
7#include "qqnxscreen.h"
9#include "qqnxwindow.h"
10
11#include "private/qeglconvenience_p.h"
12
13#include <QtCore/QDebug>
14#include <QtGui/QOpenGLContext>
15#include <QtGui/QScreen>
16
17#include <dlfcn.h>
18
20
21Q_LOGGING_CATEGORY(lcQpaGLContext, "qt.qpa.glcontext");
22
24{
25 QEGLPlatformContext::Flags result = {};
26
27 if (!QQnxIntegration::instance()->options().testFlag(QQnxIntegration::SurfacelessEGLContext))
28 result |= QEGLPlatformContext::NoSurfaceless;
29
30 return result;
31}
32
33QQnxGLContext::QQnxGLContext(const QSurfaceFormat &format, QPlatformOpenGLContext *share)
35 makeFlags())
36{
37}
38
42
43EGLSurface QQnxGLContext::eglSurfaceForPlatformSurface(QPlatformSurface *surface)
44{
45 QQnxEglWindow *window = static_cast<QQnxEglWindow *>(surface);
46 window->ensureInitialized(this);
47 return window->surface();
48}
49
50bool QQnxGLContext::makeCurrent(QPlatformSurface *surface)
51{
52 qCDebug(lcQpaGLContext) << Q_FUNC_INFO;
53 return QEGLPlatformContext::makeCurrent(surface);
54}
55
56void QQnxGLContext::swapBuffers(QPlatformSurface *surface)
57{
58 qCDebug(lcQpaGLContext) << Q_FUNC_INFO;
59
60 QQnxEglWindow *platformWindow = static_cast<QQnxEglWindow*>(surface);
61 platformWindow->windowPosted();
62 QEGLPlatformContext::swapBuffers(surface);
63}
64
66{
67 QEGLPlatformContext::doneCurrent();
68}
69
70QT_END_NAMESPACE
EGLSurface surface() const
void ensureInitialized(QQnxGLContext *context)
void doneCurrent() override
bool makeCurrent(QPlatformSurface *surface) override
EGLSurface eglSurfaceForPlatformSurface(QPlatformSurface *surface) override
virtual ~QQnxGLContext()
QQnxGLContext(const QSurfaceFormat &format, QPlatformOpenGLContext *share)
void swapBuffers(QPlatformSurface *surface) override
Reimplement in subclass to native swap buffers calls.
void windowPosted()
Q_LOGGING_CATEGORY(lcEventDispatcher, "qt.eventdispatcher")
static QEGLPlatformContext::Flags makeFlags()