Fix compilation with experimental x11 paint engine feature
Adding support for vertical subpixel positions in d79a9b1a4f694a227ce62ccab9b44685a9755916 changed some private APIs which were used from the xcb-native-painting feature. This fixes this (it does not implement vertical subpixels but simply sets the vertical subpixel position to 0). It also adds a missing "override" which triggered the warnings-are-errors when compiling for me. Fixes: QTBUG-92011 Change-Id: If214a0d19a41e623ca9ef8e6215bc145f9846ae9 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> (cherry picked from commit 70251867a50f9f606a7ceaf2338375a67e413b83) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
cc3260b37a
commit
7c3311e196
@ -363,7 +363,7 @@ private:
|
|||||||
Q_DECLARE_TYPEINFO(QFontEngineFT::QGlyphSet, Q_RELOCATABLE_TYPE);
|
Q_DECLARE_TYPEINFO(QFontEngineFT::QGlyphSet, Q_RELOCATABLE_TYPE);
|
||||||
|
|
||||||
|
|
||||||
inline size_t qHash(const QFontEngineFT::GlyphAndSubPixelPosition &g, size_t seed)
|
inline size_t qHash(const QFontEngineFT::GlyphAndSubPixelPosition &g, size_t seed = 0)
|
||||||
{
|
{
|
||||||
return qHashMulti(seed,
|
return qHashMulti(seed,
|
||||||
g.glyph,
|
g.glyph,
|
||||||
|
@ -70,7 +70,7 @@ public:
|
|||||||
XTrapezoid *traps;
|
XTrapezoid *traps;
|
||||||
int allocated;
|
int allocated;
|
||||||
int size;
|
int size;
|
||||||
void addTrap(const Trapezoid &trap);
|
void addTrap(const Trapezoid &trap) override;
|
||||||
QRect tessellate(const QPointF *points, int nPoints, bool winding) {
|
QRect tessellate(const QPointF *points, int nPoints, bool winding) {
|
||||||
size = 0;
|
size = 0;
|
||||||
setWinding(winding);
|
setWinding(winding);
|
||||||
@ -2454,7 +2454,7 @@ static bool path_for_glyphs(QPainterPath *path,
|
|||||||
ft->lockFace();
|
ft->lockFace();
|
||||||
int i = 0;
|
int i = 0;
|
||||||
while (i < glyphs.size()) {
|
while (i < glyphs.size()) {
|
||||||
QFontEngineFT::Glyph *glyph = ft->loadGlyph(glyphs[i], 0, QFontEngineFT::Format_Mono);
|
QFontEngineFT::Glyph *glyph = ft->loadGlyph(glyphs[i], QFixedPoint(), QFontEngineFT::Format_Mono);
|
||||||
// #### fix case where we don't get a glyph
|
// #### fix case where we don't get a glyph
|
||||||
if (!glyph || glyph->format != QFontEngineFT::Format_Mono) {
|
if (!glyph || glyph->format != QFontEngineFT::Format_Mono) {
|
||||||
result = false;
|
result = false;
|
||||||
@ -2606,7 +2606,8 @@ bool QXRenderGlyphCache::addGlyphs(const QTextItemInt &ti,
|
|||||||
XGlyphInfo xglyphinfo;
|
XGlyphInfo xglyphinfo;
|
||||||
|
|
||||||
for (int i = 0; i < glyphs.size(); ++i) {
|
for (int i = 0; i < glyphs.size(); ++i) {
|
||||||
const QFixed spp = ft->subPixelPositionForX(positions[i].x);
|
const QFixed sppx = ft->subPixelPositionForX(positions[i].x);
|
||||||
|
const QFixedPoint spp(sppx, 0);
|
||||||
QFontEngineFT::Glyph *glyph = set->getGlyph(glyphs[i], spp);
|
QFontEngineFT::Glyph *glyph = set->getGlyph(glyphs[i], spp);
|
||||||
Glyph xglyphid = qHash(QFontEngineFT::GlyphAndSubPixelPosition(glyphs[i], spp));
|
Glyph xglyphid = qHash(QFontEngineFT::GlyphAndSubPixelPosition(glyphs[i], spp));
|
||||||
|
|
||||||
@ -2698,7 +2699,8 @@ bool QXRenderGlyphCache::draw(Drawable src, Drawable dst, const QTransform &matr
|
|||||||
if (!isValidCoordinate(positions[i]))
|
if (!isValidCoordinate(positions[i]))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
const QFixed spp = ft->subPixelPositionForX(positions[i].x);
|
const QFixed sppx = ft->subPixelPositionForX(positions[i].x);
|
||||||
|
const QFixedPoint spp(sppx, 0);
|
||||||
QFontEngineFT::Glyph *g = set->getGlyph(glyphs[i], spp);
|
QFontEngineFT::Glyph *g = set->getGlyph(glyphs[i], spp);
|
||||||
|
|
||||||
if (g
|
if (g
|
||||||
@ -2825,7 +2827,7 @@ QFontEngine::GlyphFormat QXRenderGlyphCache::glyphFormatForDepth(QFontEngine *fo
|
|||||||
|
|
||||||
Glyph QXRenderGlyphCache::glyphId(glyph_t glyph, QFixed subPixelPosition)
|
Glyph QXRenderGlyphCache::glyphId(glyph_t glyph, QFixed subPixelPosition)
|
||||||
{
|
{
|
||||||
return qHash(QFontEngineFT::GlyphAndSubPixelPosition(glyph, subPixelPosition));
|
return qHash(QFontEngineFT::GlyphAndSubPixelPosition(glyph, QFixedPoint(subPixelPosition, 0)));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QXRenderGlyphCache::isValidCoordinate(const QFixedPoint &fp)
|
bool QXRenderGlyphCache::isValidCoordinate(const QFixedPoint &fp)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user