Source

Target

Commits (7)
Showing with 21 additions and 11 deletions
requires(!winrt:!watchos:qtHaveModule(websockets):qtHaveModule(gui))
requires(!winrt:!watchos:qtHaveModule(websockets):qtHaveModule(gui):qtConfig(opengl))
load(qt_parts)
......@@ -179,6 +179,7 @@ QPlatformTheme *QWebGLIntegration::createPlatformTheme(const QString &name) cons
QPlatformBackingStore *QWebGLIntegration::createPlatformBackingStore(QWindow *window) const
{
Q_UNUSED(window);
qCCritical(lcWebGL, "WebGL QPA platform plugin: Raster surfaces are not supported");
return nullptr;
}
......@@ -257,14 +258,13 @@ QPlatformOpenGLContext *QWebGLIntegration::createPlatformOpenGLContext(QOpenGLCo
bool QWebGLIntegration::hasCapability(QPlatformIntegration::Capability cap) const
{
// We assume that devices will have more and not less capabilities
switch (cap) {
case ThreadedPixmaps: return true;
case OpenGL: return true;
case ThreadedOpenGL: return true;
case WindowManagement: return false;
case RasterGLSurface: return true;
default: return QPlatformIntegration::hasCapability(cap);
case OpenGL:
case ThreadedOpenGL:
case ThreadedPixmaps:
return true;
default:
return false;
}
}
......
......@@ -43,6 +43,7 @@
#include <QtFontDatabaseSupport/private/qwindowsfontdatabase_p.h>
#include <QtEventDispatcherSupport/private/qwindowsguieventdispatcher_p.h>
#elif defined(Q_OS_MACOS)
#include <QtFontDatabaseSupport/private/qfontengine_coretext_p.h>
#include <QtFontDatabaseSupport/private/qcoretextfontdatabase_p.h>
#include <QtEventDispatcherSupport/private/qgenericunixeventdispatcher_p.h>
#else
......@@ -73,7 +74,7 @@ public:
#if defined(Q_OS_WIN)
mutable QWindowsFontDatabase fontDatabase;
#elif defined(Q_OS_MACOS)
mutable QCoreTextFontDatabase fontDatabase;
mutable QCoreTextFontDatabaseEngineFactory<QCoreTextFontEngine> fontDatabase;
#else
mutable QGenericUnixFontDatabase fontDatabase;
#endif
......
......@@ -149,6 +149,12 @@ QWebGLScreen *QWebGLWindow::screen() const
return static_cast<QWebGLScreen *>(QPlatformWindow::screen());
}
void QWebGLWindow::setGeometry(const QRect &rect)
{
QWindowSystemInterface::handleGeometryChange(window(), rect);
QPlatformWindow::setGeometry(rect);
}
void QWebGLWindow::setDefaults(const QMap<GLenum, QVariant> &values)
{
Q_D(QWebGLWindow);
......
......@@ -63,6 +63,7 @@ public:
QWebGLScreen *screen() const;
void setGeometry(const QRect &rect) override;
void setDefaults(const QMap<GLenum, QVariant> &values);
private:
......
......@@ -958,10 +958,12 @@ window.onload = function () {
obj["parameterCount"] = 4;
else if (obj["function"] === "swapBuffers")
obj["parameterCount"] = 0;
else if (obj["function"] == "drawArrays")
obj["parameterCount"] = null; // glDrawArrays has a variable number of arguments
else
obj["parameterCount"] = gl[obj["function"]].length;
function deserialize(container, count) {
for (var i = 0; i < count; ++i) {
for (var i = 0; count != null ? i < count : offset + 4 < buffer.byteLength; ++i) {
var character = view.getUint8(offset);
offset += 1;
var parameterType = String.fromCharCode(character);
......@@ -1006,7 +1008,7 @@ window.onload = function () {
};
deserialize(obj.parameters, obj.parameterCount);
var magic = view.getUint32(offset);
if (magic !== 0xbaadf00d)
if (magic !== 0xbaadf00d) // sentinel expected at end of buffer
console.error('Invalid magic');
offset += 4;
if (offset !== buffer.byteLength)
......