diff options
Diffstat (limited to 'src/platformsupport')
7 files changed, 39 insertions, 94 deletions
diff --git a/src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp b/src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp index b608e7f483..6011941982 100644 --- a/src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp +++ b/src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp @@ -106,7 +106,7 @@ static bool ft_getSfntTable(void *user_data, uint tag, uchar *buffer, uint *leng return result; } -static QFontEngineFT::Glyph emptyGlyph = {0, 0, 0, 0, 0, 0, 0, 0}; +static QFontEngineFT::Glyph emptyGlyph; static const QFontEngine::HintStyle ftInitialDefaultHintStyle = #ifdef Q_OS_WIN @@ -550,11 +550,6 @@ void QFreetypeFace::addBitmapToPath(FT_GlyphSlot slot, const QFixedPoint &point, slot->bitmap.buffer, slot->bitmap.pitch, slot->bitmap.width, slot->bitmap.rows, path); } -QFontEngineFT::Glyph::~Glyph() -{ - delete [] data; -} - static inline void convertRGBToARGB(const uchar *src, uint *dst, int width, int height, int src_pitch, bool bgr) { const int offs = bgr ? -1 : 1; @@ -1810,11 +1805,10 @@ static inline QImage alphaMapFromGlyphData(QFontEngineFT::Glyph *glyph, QFontEng return img; } -QImage *QFontEngineFT::lockedAlphaMapForGlyph(glyph_t glyphIndex, QFixed subPixelPosition, - QFontEngine::GlyphFormat neededFormat, - const QTransform &t, QPoint *offset) +QFontEngine::Glyph *QFontEngineFT::glyphData(glyph_t glyphIndex, QFixed subPixelPosition, + QFontEngine::GlyphFormat neededFormat, const QTransform &t) { - Q_ASSERT(currentlyLockedAlphaMap.isNull()); + Q_ASSERT(cacheEnabled); if (isBitmapFont()) neededFormat = Format_Mono; @@ -1824,33 +1818,10 @@ QImage *QFontEngineFT::lockedAlphaMapForGlyph(glyph_t glyphIndex, QFixed subPixe neededFormat = Format_A8; Glyph *glyph = loadGlyphFor(glyphIndex, subPixelPosition, neededFormat, t); - - if (offset != 0 && glyph != 0) - *offset = QPoint(glyph->x, -glyph->y); - - currentlyLockedAlphaMap = alphaMapFromGlyphData(glyph, neededFormat); - - const bool glyphHasGeometry = glyph != nullptr && glyph->height != 0 && glyph->width != 0; - if (!cacheEnabled && glyph != &emptyGlyph) { - currentlyLockedAlphaMap = currentlyLockedAlphaMap.copy(); - delete glyph; - } - - if (!glyphHasGeometry) + if (!glyph || !glyph->width || !glyph->height) return nullptr; - if (currentlyLockedAlphaMap.isNull()) - return QFontEngine::lockedAlphaMapForGlyph(glyphIndex, subPixelPosition, neededFormat, t, offset); - - QImageData *data = currentlyLockedAlphaMap.data_ptr(); - data->is_locked = true; - - return ¤tlyLockedAlphaMap; -} - -void QFontEngineFT::unlockAlphaMapForGlyph() -{ - QFontEngine::unlockAlphaMapForGlyph(); + return glyph; } static inline bool is2dRotation(const QTransform &t) diff --git a/src/platformsupport/fontdatabases/freetype/qfontengine_ft_p.h b/src/platformsupport/fontdatabases/freetype/qfontengine_ft_p.h index b636c42e63..2e3aef6979 100644 --- a/src/platformsupport/fontdatabases/freetype/qfontengine_ft_p.h +++ b/src/platformsupport/fontdatabases/freetype/qfontengine_ft_p.h @@ -129,20 +129,6 @@ private: class QFontEngineFT : public QFontEngine { public: - - /* we don't cache glyphs that are too large anyway, so we can make this struct rather small */ - struct Glyph { - ~Glyph(); - int linearAdvance : 22; - unsigned char width; - unsigned char height; - short x; - short y; - short advance; - signed char format; - uchar *data; - }; - struct GlyphInfo { int linearAdvance; unsigned short width; @@ -241,11 +227,9 @@ private: QFixed subPixelPosition, const QTransform &matrix, QFontEngine::GlyphFormat format) override; - QImage *lockedAlphaMapForGlyph(glyph_t glyph, QFixed subPixelPosition, - GlyphFormat neededFormat, const QTransform &t, - QPoint *offset) override; + Glyph *glyphData(glyph_t glyph, QFixed subPixelPosition, + GlyphFormat neededFormat, const QTransform &t) override; bool hasInternalCaching() const override { return cacheEnabled; } - void unlockAlphaMapForGlyph() override; bool expectsGammaCorrectedBlending() const override; void removeGlyphFromCache(glyph_t glyph) override; diff --git a/src/platformsupport/glxconvenience/qglxconvenience.cpp b/src/platformsupport/glxconvenience/qglxconvenience.cpp index 948b00596f..81bccb1c25 100644 --- a/src/platformsupport/glxconvenience/qglxconvenience.cpp +++ b/src/platformsupport/glxconvenience/qglxconvenience.cpp @@ -261,9 +261,11 @@ GLXFBConfig qglx_findConfig(Display *display, int screen , QSurfaceFormat format qCDebug(lcGlx) << "qglx_findConfig: Found non-matching but compatible FBConfig"; return compatibleCandidate; } - qCWarning(lcGlx, "qglx_findConfig: Failed to finding matching FBConfig (%d %d %d %d)", requestedRed, requestedGreen, requestedBlue, requestedAlpha); } while (qglx_reduceFormat(&format)); + if (!config) + qCWarning(lcGlx) << "qglx_findConfig: Failed to finding matching FBConfig for" << format; + return config; } diff --git a/src/platformsupport/kmsconvenience/qkmsdevice.cpp b/src/platformsupport/kmsconvenience/qkmsdevice.cpp index 1ba32895f8..d9d76c1146 100644 --- a/src/platformsupport/kmsconvenience/qkmsdevice.cpp +++ b/src/platformsupport/kmsconvenience/qkmsdevice.cpp @@ -387,23 +387,26 @@ QPlatformScreen *QKmsDevice::createScreenForConnector(drmModeResPtr resources, if (!cloneSource.isEmpty()) qCDebug(qLcKmsDebug) << "Output" << connectorName << " clones output " << cloneSource; - const QByteArray fbsize = userConnectorConfig.value(QStringLiteral("size")).toByteArray().toLower(); QSize framebufferSize; - framebufferSize.setWidth(modes[selected_mode].hdisplay); - framebufferSize.setHeight(modes[selected_mode].vdisplay); - + bool framebufferSizeSet = false; + const QByteArray fbsize = userConnectorConfig.value(QStringLiteral("size")).toByteArray().toLower(); + if (!fbsize.isEmpty()) { + if (sscanf(fbsize.constData(), "%dx%d", &framebufferSize.rwidth(), &framebufferSize.rheight()) == 2) { #if QT_CONFIG(drm_atomic) - if (hasAtomicSupport()) { - if (sscanf(fbsize.constData(), "%dx%d", &framebufferSize.rwidth(), &framebufferSize.rheight()) != 2) { - qWarning("Framebuffer size format is invalid."); + if (hasAtomicSupport()) + framebufferSizeSet = true; +#endif + if (!framebufferSizeSet) + qWarning("Setting framebuffer size is only available with DRM atomic API"); + } else { + qWarning("Invalid framebuffer size '%s'", fbsize.constData()); } - } else { - qWarning("Setting framebuffer size is only available with DRM atomic API"); } -#else - if (fbsize.size()) - qWarning("Setting framebuffer size is only available with DRM atomic API"); -#endif + if (!framebufferSizeSet) { + framebufferSize.setWidth(modes[selected_mode].hdisplay); + framebufferSize.setHeight(modes[selected_mode].vdisplay); + } + qCDebug(qLcKmsDebug) << "Output" << connectorName << "framebuffer size is " << framebufferSize; QKmsOutput output; @@ -851,6 +854,8 @@ void QKmsDevice::discoverPlanes() plane.crtcYPropertyId = prop->prop_id; } else if (!strcasecmp(prop->name, "zpos")) { plane.zposPropertyId = prop->prop_id; + } else if (!strcasecmp(prop->name, "blend_op")) { + plane.blendOpPropertyId = prop->prop_id; } }); diff --git a/src/platformsupport/kmsconvenience/qkmsdevice_p.h b/src/platformsupport/kmsconvenience/qkmsdevice_p.h index 403972fbb8..77070c293d 100644 --- a/src/platformsupport/kmsconvenience/qkmsdevice_p.h +++ b/src/platformsupport/kmsconvenience/qkmsdevice_p.h @@ -178,6 +178,7 @@ struct QKmsPlane uint32_t crtcwidthPropertyId = 0; uint32_t crtcheightPropertyId = 0; uint32_t zposPropertyId = 0; + uint32_t blendOpPropertyId = 0; }; Q_DECLARE_OPERATORS_FOR_FLAGS(QKmsPlane::Rotations) diff --git a/src/platformsupport/themes/genericunix/dbusmenu/qdbusmenuregistrarproxy_p.h b/src/platformsupport/themes/genericunix/dbusmenu/qdbusmenuregistrarproxy_p.h index c92de0a140..cffc080f87 100644 --- a/src/platformsupport/themes/genericunix/dbusmenu/qdbusmenuregistrarproxy_p.h +++ b/src/platformsupport/themes/genericunix/dbusmenu/qdbusmenuregistrarproxy_p.h @@ -92,15 +92,11 @@ public: public Q_SLOTS: // METHODS QDBusPendingReply<QString, QDBusObjectPath> GetMenuForWindow(uint windowId) { - QList<QVariant> argumentList; - argumentList << QVariant::fromValue(windowId); - return asyncCallWithArgumentList(QStringLiteral("GetMenuForWindow"), argumentList); + return asyncCall(QStringLiteral("GetMenuForWindow"), windowId); } QDBusReply<QString> GetMenuForWindow(uint windowId, QDBusObjectPath &menuObjectPath) { - QList<QVariant> argumentList; - argumentList << QVariant::fromValue(windowId); - QDBusMessage reply = callWithArgumentList(QDBus::Block, QStringLiteral("GetMenuForWindow"), argumentList); + QDBusMessage reply = call(QDBus::Block, QStringLiteral("GetMenuForWindow"), windowId); QList<QVariant> arguments = reply.arguments(); if (reply.type() == QDBusMessage::ReplyMessage && arguments.count() == 2) menuObjectPath = qdbus_cast<QDBusObjectPath>(arguments.at(1)); @@ -109,16 +105,12 @@ public Q_SLOTS: // METHODS QDBusPendingReply<> RegisterWindow(uint windowId, const QDBusObjectPath &menuObjectPath) { - QList<QVariant> argumentList; - argumentList << QVariant::fromValue(windowId) << QVariant::fromValue(menuObjectPath); - return asyncCallWithArgumentList(QStringLiteral("RegisterWindow"), argumentList); + return asyncCall(QStringLiteral("RegisterWindow"), windowId, menuObjectPath); } QDBusPendingReply<> UnregisterWindow(uint windowId) { - QList<QVariant> argumentList; - argumentList << QVariant::fromValue(windowId); - return asyncCallWithArgumentList(QStringLiteral("UnregisterWindow"), argumentList); + return asyncCall(QStringLiteral("UnregisterWindow"), windowId); } }; diff --git a/src/platformsupport/themes/genericunix/dbustray/qxdgnotificationproxy_p.h b/src/platformsupport/themes/genericunix/dbustray/qxdgnotificationproxy_p.h index ab99ea65dd..2194a787eb 100644 --- a/src/platformsupport/themes/genericunix/dbustray/qxdgnotificationproxy_p.h +++ b/src/platformsupport/themes/genericunix/dbustray/qxdgnotificationproxy_p.h @@ -95,26 +95,21 @@ public: public Q_SLOTS: // METHODS inline QDBusPendingReply<> closeNotification(uint id) { - QList<QVariant> argumentList; - argumentList << QVariant::fromValue(id); - return asyncCallWithArgumentList(QStringLiteral("CloseNotification"), argumentList); + return asyncCall(QStringLiteral("CloseNotification"), id); } inline QDBusPendingReply<QStringList> getCapabilities() { - QList<QVariant> argumentList; - return asyncCallWithArgumentList(QStringLiteral("GetCapabilities"), argumentList); + return asyncCall(QStringLiteral("GetCapabilities")); } inline QDBusPendingReply<QString, QString, QString, QString> getServerInformation() { - QList<QVariant> argumentList; - return asyncCallWithArgumentList(QStringLiteral("GetServerInformation"), argumentList); + return asyncCall(QStringLiteral("GetServerInformation")); } inline QDBusReply<QString> getServerInformation(QString &vendor, QString &version, QString &specVersion) { - QList<QVariant> argumentList; - QDBusMessage reply = callWithArgumentList(QDBus::Block, QStringLiteral("GetServerInformation"), argumentList); + QDBusMessage reply = call(QDBus::Block, QStringLiteral("GetServerInformation")); if (reply.type() == QDBusMessage::ReplyMessage && reply.arguments().count() == 4) { vendor = qdbus_cast<QString>(reply.arguments().at(1)); version = qdbus_cast<QString>(reply.arguments().at(2)); @@ -129,12 +124,7 @@ public Q_SLOTS: // METHODS const QVariantMap &hints, int timeout) { qCDebug(qLcTray) << appName << replacesId << appIcon << summary << body << actions << hints << timeout; - QList<QVariant> argumentList; - argumentList << QVariant::fromValue(appName) << QVariant::fromValue(replacesId) << - QVariant::fromValue(appIcon) << QVariant::fromValue(summary) << - QVariant::fromValue(body) << QVariant::fromValue(actions) << - QVariant::fromValue(hints) << QVariant::fromValue(timeout); - return asyncCallWithArgumentList(QStringLiteral("Notify"), argumentList); + return asyncCall(QStringLiteral("Notify"), appName, replacesId, appIcon, summary, body, actions, hints, timeout); } Q_SIGNALS: |