iOS: Fix build with -no-opengl
Change-Id: I014fa1772f629ef4224ac98bfc30eb5a86f38fde Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit ae92c571a36703f6ab95d98b55d070cc57023376) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
b9ed727556
commit
c988a7eeb6
@ -15,7 +15,6 @@ qt_internal_add_plugin(QIOSIntegrationPlugin
|
|||||||
plugin.mm
|
plugin.mm
|
||||||
qiosapplicationdelegate.h qiosapplicationdelegate.mm
|
qiosapplicationdelegate.h qiosapplicationdelegate.mm
|
||||||
qiosapplicationstate.h qiosapplicationstate.mm
|
qiosapplicationstate.h qiosapplicationstate.mm
|
||||||
qioscontext.h qioscontext.mm
|
|
||||||
qioseventdispatcher.h qioseventdispatcher.mm
|
qioseventdispatcher.h qioseventdispatcher.mm
|
||||||
qiosglobal.h qiosglobal.mm
|
qiosglobal.h qiosglobal.mm
|
||||||
qiosinputcontext.h qiosinputcontext.mm
|
qiosinputcontext.h qiosinputcontext.mm
|
||||||
@ -51,6 +50,8 @@ qt_disable_apple_app_extension_api_only(QIOSIntegrationPlugin)
|
|||||||
qt_internal_find_apple_system_framework(FWUniformTypeIdentifiers UniformTypeIdentifiers)
|
qt_internal_find_apple_system_framework(FWUniformTypeIdentifiers UniformTypeIdentifiers)
|
||||||
|
|
||||||
qt_internal_extend_target(QIOSIntegrationPlugin CONDITION QT_FEATURE_opengl
|
qt_internal_extend_target(QIOSIntegrationPlugin CONDITION QT_FEATURE_opengl
|
||||||
|
SOURCES
|
||||||
|
qioscontext.h qioscontext.mm
|
||||||
LIBRARIES
|
LIBRARIES
|
||||||
Qt::OpenGLPrivate
|
Qt::OpenGLPrivate
|
||||||
)
|
)
|
||||||
|
@ -33,7 +33,10 @@ public:
|
|||||||
QPlatformWindow *createPlatformWindow(QWindow *window) const override;
|
QPlatformWindow *createPlatformWindow(QWindow *window) const override;
|
||||||
QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const override;
|
QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const override;
|
||||||
|
|
||||||
|
#if QT_CONFIG(opengl)
|
||||||
QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const override;
|
QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const override;
|
||||||
|
#endif
|
||||||
|
|
||||||
QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const override;
|
QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const override;
|
||||||
|
|
||||||
QPlatformFontDatabase *fontDatabase() const override;
|
QPlatformFontDatabase *fontDatabase() const override;
|
||||||
|
@ -7,7 +7,6 @@
|
|||||||
#include "qioswindow.h"
|
#include "qioswindow.h"
|
||||||
#include "qiosscreen.h"
|
#include "qiosscreen.h"
|
||||||
#include "qiosplatformaccessibility.h"
|
#include "qiosplatformaccessibility.h"
|
||||||
#include "qioscontext.h"
|
|
||||||
#ifndef Q_OS_TVOS
|
#ifndef Q_OS_TVOS
|
||||||
#include "qiosclipboard.h"
|
#include "qiosclipboard.h"
|
||||||
#endif
|
#endif
|
||||||
@ -29,6 +28,10 @@
|
|||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QOperatingSystemVersion>
|
#include <QOperatingSystemVersion>
|
||||||
|
|
||||||
|
#if QT_CONFIG(opengl)
|
||||||
|
#include "qioscontext.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#import <AudioToolbox/AudioServices.h>
|
#import <AudioToolbox/AudioServices.h>
|
||||||
|
|
||||||
#include <QtDebug>
|
#include <QtDebug>
|
||||||
@ -128,11 +131,15 @@ QIOSIntegration::~QIOSIntegration()
|
|||||||
bool QIOSIntegration::hasCapability(Capability cap) const
|
bool QIOSIntegration::hasCapability(Capability cap) const
|
||||||
{
|
{
|
||||||
switch (cap) {
|
switch (cap) {
|
||||||
|
#if QT_CONFIG(opengl)
|
||||||
case BufferQueueingOpenGL:
|
case BufferQueueingOpenGL:
|
||||||
return true;
|
return true;
|
||||||
case OpenGL:
|
case OpenGL:
|
||||||
case ThreadedOpenGL:
|
case ThreadedOpenGL:
|
||||||
return true;
|
return true;
|
||||||
|
case RasterGLSurface:
|
||||||
|
return true;
|
||||||
|
#endif
|
||||||
case ThreadedPixmaps:
|
case ThreadedPixmaps:
|
||||||
return true;
|
return true;
|
||||||
case MultipleWindows:
|
case MultipleWindows:
|
||||||
@ -141,8 +148,6 @@ bool QIOSIntegration::hasCapability(Capability cap) const
|
|||||||
return false;
|
return false;
|
||||||
case ApplicationState:
|
case ApplicationState:
|
||||||
return true;
|
return true;
|
||||||
case RasterGLSurface:
|
|
||||||
return true;
|
|
||||||
default:
|
default:
|
||||||
return QPlatformIntegration::hasCapability(cap);
|
return QPlatformIntegration::hasCapability(cap);
|
||||||
}
|
}
|
||||||
@ -158,11 +163,13 @@ QPlatformBackingStore *QIOSIntegration::createPlatformBackingStore(QWindow *wind
|
|||||||
return new QRhiBackingStore(window);
|
return new QRhiBackingStore(window);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if QT_CONFIG(opengl)
|
||||||
// Used when the QWindow's surface type is set by the client to QSurface::OpenGLSurface
|
// Used when the QWindow's surface type is set by the client to QSurface::OpenGLSurface
|
||||||
QPlatformOpenGLContext *QIOSIntegration::createPlatformOpenGLContext(QOpenGLContext *context) const
|
QPlatformOpenGLContext *QIOSIntegration::createPlatformOpenGLContext(QOpenGLContext *context) const
|
||||||
{
|
{
|
||||||
return new QIOSContext(context);
|
return new QIOSContext(context);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
class QIOSOffscreenSurface : public QPlatformOffscreenSurface
|
class QIOSOffscreenSurface : public QPlatformOffscreenSurface
|
||||||
{
|
{
|
||||||
|
@ -56,7 +56,9 @@ public:
|
|||||||
|
|
||||||
void requestUpdate() override;
|
void requestUpdate() override;
|
||||||
|
|
||||||
|
#if QT_CONFIG(opengl)
|
||||||
CAEAGLLayer *eaglLayer() const;
|
CAEAGLLayer *eaglLayer() const;
|
||||||
|
#endif
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void applicationStateChanged(Qt::ApplicationState state);
|
void applicationStateChanged(Qt::ApplicationState state);
|
||||||
|
@ -4,7 +4,6 @@
|
|||||||
#include "qioswindow.h"
|
#include "qioswindow.h"
|
||||||
|
|
||||||
#include "qiosapplicationdelegate.h"
|
#include "qiosapplicationdelegate.h"
|
||||||
#include "qioscontext.h"
|
|
||||||
#include "qiosglobal.h"
|
#include "qiosglobal.h"
|
||||||
#include "qiosintegration.h"
|
#include "qiosintegration.h"
|
||||||
#include "qiosscreen.h"
|
#include "qiosscreen.h"
|
||||||
@ -15,7 +14,10 @@
|
|||||||
#include <QtGui/private/qwindow_p.h>
|
#include <QtGui/private/qwindow_p.h>
|
||||||
#include <qpa/qplatformintegration.h>
|
#include <qpa/qplatformintegration.h>
|
||||||
|
|
||||||
|
#if QT_CONFIG(opengl)
|
||||||
#import <QuartzCore/CAEAGLLayer.h>
|
#import <QuartzCore/CAEAGLLayer.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef Q_OS_IOS
|
#ifdef Q_OS_IOS
|
||||||
#import <QuartzCore/CAMetalLayer.h>
|
#import <QuartzCore/CAMetalLayer.h>
|
||||||
#endif
|
#endif
|
||||||
@ -352,11 +354,13 @@ void QIOSWindow::requestUpdate()
|
|||||||
static_cast<QIOSScreen *>(screen())->setUpdatesPaused(false);
|
static_cast<QIOSScreen *>(screen())->setUpdatesPaused(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if QT_CONFIG(opengl)
|
||||||
CAEAGLLayer *QIOSWindow::eaglLayer() const
|
CAEAGLLayer *QIOSWindow::eaglLayer() const
|
||||||
{
|
{
|
||||||
Q_ASSERT([m_view.layer isKindOfClass:[CAEAGLLayer class]]);
|
Q_ASSERT([m_view.layer isKindOfClass:[CAEAGLLayer class]]);
|
||||||
return static_cast<CAEAGLLayer *>(m_view.layer);
|
return static_cast<CAEAGLLayer *>(m_view.layer);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef QT_NO_DEBUG_STREAM
|
#ifndef QT_NO_DEBUG_STREAM
|
||||||
QDebug operator<<(QDebug debug, const QIOSWindow *window)
|
QDebug operator<<(QDebug debug, const QIOSWindow *window)
|
||||||
|
@ -82,7 +82,10 @@ inline ulong getTimeStamp(UIEvent *event)
|
|||||||
|
|
||||||
+ (Class)layerClass
|
+ (Class)layerClass
|
||||||
{
|
{
|
||||||
|
#if QT_CONFIG(opengl)
|
||||||
return [CAEAGLLayer class];
|
return [CAEAGLLayer class];
|
||||||
|
#endif
|
||||||
|
return [super layerClass];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (instancetype)initWithQIOSWindow:(QT_PREPEND_NAMESPACE(QIOSWindow) *)window
|
- (instancetype)initWithQIOSWindow:(QT_PREPEND_NAMESPACE(QIOSWindow) *)window
|
||||||
@ -113,6 +116,7 @@ inline ulong getTimeStamp(UIEvent *event)
|
|||||||
- (instancetype)initWithFrame:(CGRect)frame
|
- (instancetype)initWithFrame:(CGRect)frame
|
||||||
{
|
{
|
||||||
if ((self = [super initWithFrame:frame])) {
|
if ((self = [super initWithFrame:frame])) {
|
||||||
|
#if QT_CONFIG(opengl)
|
||||||
if ([self.layer isKindOfClass:[CAEAGLLayer class]]) {
|
if ([self.layer isKindOfClass:[CAEAGLLayer class]]) {
|
||||||
// Set up EAGL layer
|
// Set up EAGL layer
|
||||||
CAEAGLLayer *eaglLayer = static_cast<CAEAGLLayer *>(self.layer);
|
CAEAGLLayer *eaglLayer = static_cast<CAEAGLLayer *>(self.layer);
|
||||||
@ -122,6 +126,7 @@ inline ulong getTimeStamp(UIEvent *event)
|
|||||||
kEAGLDrawablePropertyColorFormat: kEAGLColorFormatRGBA8
|
kEAGLDrawablePropertyColorFormat: kEAGLColorFormatRGBA8
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (isQtApplication())
|
if (isQtApplication())
|
||||||
self.hidden = YES;
|
self.hidden = YES;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user