From ab687458b271e1eeaebb4b1a02f7d08c335cd237 Mon Sep 17 00:00:00 2001 From: Fabian Kosmale Date: Tue, 26 Jan 2021 08:08:48 +0100 Subject: Fix compilation after subpixel handling changes in qtbase Change-Id: Ife394e660274dd9dbe17207e18c5024f90628a00 Reviewed-by: Eskil Abrahamsen Blomfeldt Reviewed-by: Allan Sandfeld Jensen Reviewed-by: Fabian Kosmale --- src/quick/scenegraph/adaptations/software/qsgsoftwareglyphnode.cpp | 2 +- src/quick/scenegraph/qsgdefaultglyphnode_p.cpp | 5 +++-- src/quick/scenegraph/qsgrhitextureglyphcache.cpp | 2 +- src/quick/scenegraph/qsgrhitextureglyphcache_p.h | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/quick/scenegraph/adaptations/software/qsgsoftwareglyphnode.cpp b/src/quick/scenegraph/adaptations/software/qsgsoftwareglyphnode.cpp index 47f4b5c696..d2c6b85b05 100644 --- a/src/quick/scenegraph/adaptations/software/qsgsoftwareglyphnode.cpp +++ b/src/quick/scenegraph/adaptations/software/qsgsoftwareglyphnode.cpp @@ -68,7 +68,7 @@ QRectF calculateBoundingRect(const QPointF &position, const QGlyphRun &glyphs) const QVector glyphIndexes = glyphs.glyphIndexes(); const QVector glyphPositions = glyphs.positions(); for (int i = 0, n = qMin(glyphIndexes.size(), glyphPositions.size()); i < n; ++i) { - glyph_metrics_t gm = fontEngine->alphaMapBoundingBox(glyphIndexes.at(i), QFixed(), QTransform(), glyphFormat); + glyph_metrics_t gm = fontEngine->alphaMapBoundingBox(glyphIndexes.at(i), QFixedPoint(), QTransform(), glyphFormat); gm.x += QFixed::fromReal(glyphPositions.at(i).x()) - margin; gm.y += QFixed::fromReal(glyphPositions.at(i).y()) - margin; diff --git a/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp b/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp index b422eea123..578b5ab2f2 100644 --- a/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp +++ b/src/quick/scenegraph/qsgdefaultglyphnode_p.cpp @@ -488,14 +488,15 @@ void QSGTextMaskMaterial::populate(const QPointF &p, Q_ASSERT(geometry->sizeOfVertex() == sizeof(QVector4D)); ushort *ip = geometry->indexDataAsUShort(); - bool supportsSubPixelPositions = fontD->fontEngine->supportsSubPixelPositions(); + bool supportsSubPixelPositions = fontD->fontEngine->supportsHorizontalSubPixelPositions(); for (int i=0; ifontEngine->subPixelPositionForX(QFixed::fromReal(glyphPosition.x())); - QTextureGlyphCache::GlyphAndSubPixelPosition glyph(glyphIndexes.at(i), subPixelPosition); + QTextureGlyphCache::GlyphAndSubPixelPosition glyph(glyphIndexes.at(i), + QFixedPoint(subPixelPosition, 0)); const QTextureGlyphCache::Coord &c = cache->coords.value(glyph); // On a retina screen the glyph positions are not pre-scaled (as opposed to diff --git a/src/quick/scenegraph/qsgrhitextureglyphcache.cpp b/src/quick/scenegraph/qsgrhitextureglyphcache.cpp index 45ebe31921..1ec7e0c92d 100644 --- a/src/quick/scenegraph/qsgrhitextureglyphcache.cpp +++ b/src/quick/scenegraph/qsgrhitextureglyphcache.cpp @@ -184,7 +184,7 @@ void QSGRhiTextureGlyphCache::prepareGlyphImage(QImage *img) } } -void QSGRhiTextureGlyphCache::fillTexture(const Coord &c, glyph_t glyph, QFixed subPixelPosition) +void QSGRhiTextureGlyphCache::fillTexture(const Coord &c, glyph_t glyph, const QFixedPoint &subPixelPosition) { QRhiTextureSubresourceUploadDescription subresDesc; QImage mask; diff --git a/src/quick/scenegraph/qsgrhitextureglyphcache_p.h b/src/quick/scenegraph/qsgrhitextureglyphcache_p.h index 49854a596e..c3964ee09f 100644 --- a/src/quick/scenegraph/qsgrhitextureglyphcache_p.h +++ b/src/quick/scenegraph/qsgrhitextureglyphcache_p.h @@ -66,7 +66,7 @@ public: void createTextureData(int width, int height) override; void resizeTextureData(int width, int height) override; void beginFillTexture() override; - void fillTexture(const Coord &c, glyph_t glyph, QFixed subPixelPosition) override; + void fillTexture(const Coord &c, glyph_t glyph, const QFixedPoint &subPixelPosition) override; void endFillTexture() override; int glyphPadding() const override; int maxTextureWidth() const override; -- cgit v1.2.3