aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Krus <mike.krus@kdab.com>2015-12-27 21:47:40 +0000
committerMike Krus <mike.krus@kdab.com>2016-01-01 18:16:20 +0000
commitfa0e902b4b1c938f59c7fdf9bdfbd464f55e766f (patch)
treee53902c9c7abe8ad12e4cfa806deb86bd9b43ec7
parent893a4ffd6476a11597f9dd3c847fe3db4bf38eed (diff)
tvOS support
Change-Id: If48e8bcf55781d1148e15ce19e07cfbe35d829d2 Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Jake Petroules <jake.petroules@theqtcompany.com>
-rw-r--r--src/3rdparty/masm/wtf/Platform.h5
-rw-r--r--src/qml/jsruntime/jsruntime.pri2
-rw-r--r--src/qml/jsruntime/qv4global_p.h2
-rw-r--r--src/qml/qml/qqmlengine.cpp1
-rw-r--r--src/qml/qml/qqmlplatform.cpp2
-rw-r--r--src/quick/scenegraph/util/qsgatlastexture.cpp4
-rw-r--r--src/quick/scenegraph/util/qsgtexture.cpp2
7 files changed, 13 insertions, 5 deletions
diff --git a/src/3rdparty/masm/wtf/Platform.h b/src/3rdparty/masm/wtf/Platform.h
index f0612fe50e..2a2b8abc61 100644
--- a/src/3rdparty/masm/wtf/Platform.h
+++ b/src/3rdparty/masm/wtf/Platform.h
@@ -348,6 +348,11 @@
|| (defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE) \
|| (defined(TARGET_IPHONE_SIMULATOR) && TARGET_IPHONE_SIMULATOR))
#define WTF_OS_IOS 1
+#elif OS(DARWIN) && ((defined(TARGET_OS_EMBEDDED) && TARGET_OS_EMBEDDED) \
+ || (defined(TARGET_OS_APPLETV) && TARGET_OS_APPLETV) \
+ || (defined(TARGET_APPLETV_SIMULATOR) && TARGET_APPLETV_SIMULATOR))
+#define WTF_OS_IOS 1
+#define WTF_OS_TVOS 1
#elif OS(DARWIN) && defined(TARGET_OS_MAC) && TARGET_OS_MAC
#define WTF_OS_MAC_OS_X 1
diff --git a/src/qml/jsruntime/jsruntime.pri b/src/qml/jsruntime/jsruntime.pri
index 503b40e8ae..57ad85485a 100644
--- a/src/qml/jsruntime/jsruntime.pri
+++ b/src/qml/jsruntime/jsruntime.pri
@@ -111,4 +111,4 @@ valgrind {
DEFINES += V4_USE_VALGRIND
}
-ios: DEFINES += ENABLE_ASSEMBLER_WX_EXCLUSIVE=1
+ios|tvos: DEFINES += ENABLE_ASSEMBLER_WX_EXCLUSIVE=1
diff --git a/src/qml/jsruntime/qv4global_p.h b/src/qml/jsruntime/qv4global_p.h
index 01a21ea06d..0fc5af8380 100644
--- a/src/qml/jsruntime/qv4global_p.h
+++ b/src/qml/jsruntime/qv4global_p.h
@@ -105,7 +105,7 @@ inline double trunc(double d) { return d > 0 ? floor(d) : ceil(d); }
// Black list some platforms
#if defined(V4_ENABLE_JIT)
-#if defined(Q_OS_IOS) || defined(Q_OS_WINRT)
+#if defined(Q_OS_IOS) || defined(Q_OS_WINRT) || defined(Q_OS_TVOS)
# undef V4_ENABLE_JIT
#endif
#endif
diff --git a/src/qml/qml/qqmlengine.cpp b/src/qml/qml/qqmlengine.cpp
index b3636d1fa6..e02bc1350c 100644
--- a/src/qml/qml/qqmlengine.cpp
+++ b/src/qml/qml/qqmlengine.cpp
@@ -398,6 +398,7 @@ The following functions are also on the Qt object.
\li \c "android" - Android
\li \c "blackberry" - BlackBerry OS
\li \c "ios" - iOS
+ \li \c "tvos" - tvOS
\li \c "linux" - Linux
\li \c "osx" - OS X
\li \c "unix" - Other Unix-based OS
diff --git a/src/qml/qml/qqmlplatform.cpp b/src/qml/qml/qqmlplatform.cpp
index a453746da3..92e9096077 100644
--- a/src/qml/qml/qqmlplatform.cpp
+++ b/src/qml/qml/qqmlplatform.cpp
@@ -57,6 +57,8 @@ QString QQmlPlatform::os()
return QStringLiteral("blackberry");
#elif defined(Q_OS_IOS)
return QStringLiteral("ios");
+#elif defined(Q_OS_TVOS)
+ return QStringLiteral("tvos");
#elif defined(Q_OS_MAC)
return QStringLiteral("osx");
#elif defined(Q_OS_WINCE)
diff --git a/src/quick/scenegraph/util/qsgatlastexture.cpp b/src/quick/scenegraph/util/qsgatlastexture.cpp
index 8e8e870505..548d57ce00 100644
--- a/src/quick/scenegraph/util/qsgatlastexture.cpp
+++ b/src/quick/scenegraph/util/qsgatlastexture.cpp
@@ -155,11 +155,11 @@ Atlas::Atlas(const QSize &size)
|| strstr(ext, "GL_EXT_texture_format_BGRA8888")
|| strstr(ext, "GL_IMG_texture_format_BGRA8888"))) {
m_internalFormat = m_externalFormat = GL_BGRA;
-#ifdef Q_OS_IOS
+#if defined(Q_OS_DARWIN) && !defined(Q_OS_OSX)
} else if (strstr(ext, "GL_APPLE_texture_format_BGRA8888")) {
m_internalFormat = GL_RGBA;
m_externalFormat = GL_BGRA;
-#endif // IOS
+#endif // IOS || TVOS
} else {
m_internalFormat = m_externalFormat = GL_RGBA;
}
diff --git a/src/quick/scenegraph/util/qsgtexture.cpp b/src/quick/scenegraph/util/qsgtexture.cpp
index df9e569ca3..e20a8f1d87 100644
--- a/src/quick/scenegraph/util/qsgtexture.cpp
+++ b/src/quick/scenegraph/util/qsgtexture.cpp
@@ -734,7 +734,7 @@ void QSGPlainTexture::bind()
|| context->hasExtension(QByteArrayLiteral("GL_IMG_texture_format_BGRA8888")))) {
externalFormat = GL_BGRA;
internalFormat = GL_BGRA;
-#ifdef Q_OS_IOS
+#if defined(Q_OS_DARWIN) && !defined(Q_OS_OSX)
} else if (context->hasExtension(QByteArrayLiteral("GL_APPLE_texture_format_BGRA8888"))) {
externalFormat = GL_BGRA;
internalFormat = GL_RGBA;