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
6#include "qqnxscreen.h"
8
9#include "private/qeglconvenience_p.h"
10
11#include <QtCore/QDebug>
12#include <QtGui/QOpenGLContext>
13#include <QtGui/QScreen>
14
15#include <dlfcn.h>
16
18
20
22{
23 QEGLPlatformContext::Flags result = {};
24
25 if (!QQnxIntegration::instance()->options().testFlag(QQnxIntegration::SurfacelessEGLContext))
26 result |= QEGLPlatformContext::NoSurfaceless;
27
28 return result;
29}
30
31QQnxGLContext::QQnxGLContext(const QSurfaceFormat &format, QPlatformOpenGLContext *share)
33 makeFlags())
34{
35}
36
40
41EGLSurface QQnxGLContext::eglSurfaceForPlatformSurface(QPlatformSurface *surface)
42{
43 QQnxEglWindow *window = static_cast<QQnxEglWindow *>(surface);
44 window->ensureInitialized(this);
45 return window->surface();
46}
47
48bool QQnxGLContext::makeCurrent(QPlatformSurface *surface)
49{
50 qCDebug(lcQpaGLContext) << Q_FUNC_INFO;
51 return QEGLPlatformContext::makeCurrent(surface);
52}
53
54void QQnxGLContext::swapBuffers(QPlatformSurface *surface)
55{
56 qCDebug(lcQpaGLContext) << Q_FUNC_INFO;
57
58 QEGLPlatformContext::swapBuffers(surface);
59
60 QQnxEglWindow *platformWindow = static_cast<QQnxEglWindow*>(surface);
61 platformWindow->windowPosted();
62}
63
65{
66 QEGLPlatformContext::doneCurrent();
67}
68
69QT_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()
Q_DECLARE_LOGGING_CATEGORY(lcQpaGLContext)