diff options
-rw-r--r-- | config.tests/unix/fontconfig/fontconfig.cpp | 2 | ||||
-rw-r--r-- | config.tests/unix/freetype/freetype.cpp | 2 | ||||
-rw-r--r-- | mkspecs/hurd-g++/qmake.conf | 15 | ||||
-rw-r--r-- | src/gui/text/qfont.cpp | 12 | ||||
-rw-r--r-- | src/gui/text/qfontengine_ft.cpp | 69 | ||||
-rw-r--r-- | src/gui/text/qharfbuzzng.cpp | 26 | ||||
-rw-r--r-- | src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglnativeinterfacehandler.cpp | 5 | ||||
-rw-r--r-- | src/sql/drivers/mysql/qsql_mysql.cpp | 2 |
8 files changed, 53 insertions, 80 deletions
diff --git a/config.tests/unix/fontconfig/fontconfig.cpp b/config.tests/unix/fontconfig/fontconfig.cpp index 6d0eb71cbd..9348214899 100644 --- a/config.tests/unix/fontconfig/fontconfig.cpp +++ b/config.tests/unix/fontconfig/fontconfig.cpp @@ -39,7 +39,7 @@ # error "This version of fontconfig is tool old, it is missing the FC_RGBA_UNKNOWN define" #endif -#if ((FREETYPE_MAJOR*10000 + FREETYPE_MINOR*100 + FREETYPE_PATCH) < 20103) +#if ((FREETYPE_MAJOR*10000 + FREETYPE_MINOR*100 + FREETYPE_PATCH) < 20110) # error "This version of freetype is too old." #endif diff --git a/config.tests/unix/freetype/freetype.cpp b/config.tests/unix/freetype/freetype.cpp index dd337fd7e8..210bd67468 100644 --- a/config.tests/unix/freetype/freetype.cpp +++ b/config.tests/unix/freetype/freetype.cpp @@ -34,7 +34,7 @@ #include <ft2build.h> #include FT_FREETYPE_H -#if ((FREETYPE_MAJOR*10000 + FREETYPE_MINOR*100 + FREETYPE_PATCH) < 20103) +#if ((FREETYPE_MAJOR*10000 + FREETYPE_MINOR*100 + FREETYPE_PATCH) < 20110) # error "This version of freetype is too old." #endif diff --git a/mkspecs/hurd-g++/qmake.conf b/mkspecs/hurd-g++/qmake.conf index 54a152de97..d53b49ced2 100644 --- a/mkspecs/hurd-g++/qmake.conf +++ b/mkspecs/hurd-g++/qmake.conf @@ -3,19 +3,20 @@ # MAKEFILE_GENERATOR = UNIX -QMAKE_PLATFORM = hurd +QMAKE_PLATFORM += hurd CONFIG += incremental QMAKE_INCREMENTAL_STYLE = sublib QMAKE_CFLAGS_THREAD += -D_REENTRANT QMAKE_CXXFLAGS_THREAD += $$QMAKE_CFLAGS_THREAD +QMAKE_LFLAGS_GCSECTIONS = -Wl,--gc-sections QMAKE_INCDIR = QMAKE_LIBDIR = -QMAKE_INCDIR_X11 = /usr/X11R6/include -QMAKE_LIBDIR_X11 = /usr/X11R6/lib -QMAKE_INCDIR_OPENGL = /usr/X11R6/include -QMAKE_LIBDIR_OPENGL = /usr/X11R6/lib +QMAKE_INCDIR_X11 = +QMAKE_LIBDIR_X11 = +QMAKE_INCDIR_OPENGL = +QMAKE_LIBDIR_OPENGL = QMAKE_INCDIR_OPENGL_ES2 = $$QMAKE_INCDIR_OPENGL QMAKE_LIBDIR_OPENGL_ES2 = $$QMAKE_LIBDIR_OPENGL QMAKE_INCDIR_EGL = @@ -33,6 +34,10 @@ QMAKE_LIBS_OPENGL_ES2 = -lGLESv2 QMAKE_LIBS_OPENVG = -lOpenVG QMAKE_LIBS_THREAD = -lpthread +QMAKE_CFLAGS_XCB = +QMAKE_LIBS_XCB = +QMAKE_DEFINES_XCB = + QMAKE_AR = ar cqs QMAKE_OBJCOPY = objcopy QMAKE_NM = nm -P diff --git a/src/gui/text/qfont.cpp b/src/gui/text/qfont.cpp index 249276bb69..515de99c9e 100644 --- a/src/gui/text/qfont.cpp +++ b/src/gui/text/qfont.cpp @@ -406,9 +406,6 @@ QFontEngineData::~QFontEngineData() setPointSize() has a similar effect and provides device independence. - In X11 you can set a font using its system - specific name with setRawName(). - Loading fonts can be expensive, especially on X11. QFont contains extensive optimizations to make the copying of QFont objects fast, and to cache the results of the slow window system functions it @@ -1584,10 +1581,9 @@ QFont::Capitalization QFont::capitalization() const return the values set in the QFont for all parameters, including the family name). - \warning Do not use raw mode unless you really, really need it! In - most (if not all) cases, setRawName() is a much better choice. + \warning Do not use raw mode unless you really, really need it! - \sa rawMode(), setRawName() + \sa rawMode() */ void QFont::setRawMode(bool enable) { @@ -1717,7 +1713,7 @@ bool QFont::isCopyOf(const QFont & f) const Returns \c true if raw mode is used for font name matching; otherwise returns \c false. - \sa setRawMode(), rawName() + \sa setRawMode() */ bool QFont::rawMode() const { @@ -2165,7 +2161,7 @@ QString QFont::defaultFamily() const happens. Please \l{bughowto.html}{report it as a bug} if it does, preferably with a list of the fonts you have installed. - \sa lastResortFamily(), rawName() + \sa lastResortFamily() */ QString QFont::lastResortFont() const { diff --git a/src/gui/text/qfontengine_ft.cpp b/src/gui/text/qfontengine_ft.cpp index 5c1af8bb40..e0c1b46a90 100644 --- a/src/gui/text/qfontengine_ft.cpp +++ b/src/gui/text/qfontengine_ft.cpp @@ -76,34 +76,6 @@ QT_BEGIN_NAMESPACE -/* - * Freetype 2.1.7 and earlier used width/height - * for matching sizes in the BDF and PCF loaders. - * This has been fixed for 2.1.8. - */ -#if (FREETYPE_MAJOR*10000+FREETYPE_MINOR*100+FREETYPE_PATCH) >= 20105 -#define X_SIZE(face,i) ((face)->available_sizes[i].x_ppem) -#define Y_SIZE(face,i) ((face)->available_sizes[i].y_ppem) -#else -#define X_SIZE(face,i) ((face)->available_sizes[i].width << 6) -#define Y_SIZE(face,i) ((face)->available_sizes[i].height << 6) -#endif - -/* FreeType 2.1.10 starts to provide FT_GlyphSlot_Embolden */ -#if (FREETYPE_MAJOR*10000+FREETYPE_MINOR*100+FREETYPE_PATCH) >= 20110 -#define Q_FT_GLYPHSLOT_EMBOLDEN(slot) FT_GlyphSlot_Embolden(slot) -#else -#define Q_FT_GLYPHSLOT_EMBOLDEN(slot) -#endif - -/* FreeType 2.1.10 starts to provide FT_GlyphSlot_Oblique */ -#if (FREETYPE_MAJOR*10000+FREETYPE_MINOR*100+FREETYPE_PATCH) >= 20110 -#define Q_HAS_FT_GLYPHSLOT_OBLIQUE -#define Q_FT_GLYPHSLOT_OBLIQUE(slot) FT_GlyphSlot_Oblique(slot) -#else -#define Q_FT_GLYPHSLOT_OBLIQUE(slot) -#endif - #define FLOOR(x) ((x) & -64) #define CEIL(x) (((x)+63) & -64) #define TRUNC(x) ((x) >> 6) @@ -297,7 +269,7 @@ QFreetypeFace *QFreetypeFace::getFace(const QFontEngine::FaceId &face_id, } if (!FT_IS_SCALABLE(newFreetype->face) && newFreetype->face->num_fixed_sizes == 1) - FT_Set_Char_Size (face, X_SIZE(newFreetype->face, 0), Y_SIZE(newFreetype->face, 0), 0, 0); + FT_Set_Char_Size(face, newFreetype->face->available_sizes[0].x_ppem, newFreetype->face->available_sizes[0].y_ppem, 0, 0); FT_Set_Charmap(newFreetype->face, newFreetype->unicode_map); QT_TRY { @@ -357,18 +329,18 @@ void QFreetypeFace::computeSize(const QFontDef &fontDef, int *xsize, int *ysize, if (!(face->face_flags & FT_FACE_FLAG_SCALABLE)) { int best = 0; for (int i = 1; i < face->num_fixed_sizes; i++) { - if (qAbs(*ysize - Y_SIZE(face,i)) < - qAbs (*ysize - Y_SIZE(face, best)) || - (qAbs (*ysize - Y_SIZE(face, i)) == - qAbs (*ysize - Y_SIZE(face, best)) && - qAbs (*xsize - X_SIZE(face, i)) < - qAbs (*xsize - X_SIZE(face, best)))) { + if (qAbs(*ysize - face->available_sizes[i].y_ppem) < + qAbs(*ysize - face->available_sizes[best].y_ppem) || + (qAbs(*ysize - face->available_sizes[i].y_ppem) == + qAbs(*ysize - face->available_sizes[best].y_ppem) && + qAbs(*xsize - face->available_sizes[i].x_ppem) < + qAbs(*xsize - face->available_sizes[best].x_ppem))) { best = i; } } - if (FT_Set_Char_Size (face, X_SIZE(face, best), Y_SIZE(face, best), 0, 0) == 0) { - *xsize = X_SIZE(face, best); - *ysize = Y_SIZE(face, best); + if (FT_Set_Char_Size(face, face->available_sizes[best].x_ppem, face->available_sizes[best].y_ppem, 0, 0) == 0) { + *xsize = face->available_sizes[best].x_ppem; + *ysize = face->available_sizes[best].y_ppem; } else { int err = 1; if (!(face->face_flags & FT_FACE_FLAG_SCALABLE) && ysize == 0 && face->num_fixed_sizes >= 1) { @@ -719,14 +691,8 @@ bool QFontEngineFT::init(FaceId faceId, bool antialias, GlyphFormat format, if (FT_IS_SCALABLE(face)) { bool fake_oblique = (fontDef.style != QFont::StyleNormal) && !(face->style_flags & FT_STYLE_FLAG_ITALIC); - if (fake_oblique) { -#if !defined(Q_HAS_FT_GLYPHSLOT_OBLIQUE) - matrix.xy = 0x10000*3/10; - transform = true; -#else + if (fake_oblique) obliquen = true; -#endif - } FT_Set_Transform(face, &matrix, 0); freetype->matrix = matrix; // fake bold @@ -758,7 +724,7 @@ bool QFontEngineFT::init(FaceId faceId, bool antialias, GlyphFormat format, */ if (FT_IS_SCALABLE(face)) { for (int i = 0; i < face->num_fixed_sizes; ++i) { - if (xsize == X_SIZE(face, i) && ysize == Y_SIZE(face, i)) { + if (xsize == face->available_sizes[i].x_ppem && ysize == face->available_sizes[i].y_ppem) { face->face_flags &= ~FT_FACE_FLAG_SCALABLE; FT_Select_Size(face, i); @@ -908,9 +874,10 @@ QFontEngineFT::Glyph *QFontEngineFT::loadGlyph(QGlyphSet *set, uint glyph, FT_GlyphSlot slot = face->glyph; - if (embolden) Q_FT_GLYPHSLOT_EMBOLDEN(slot); + if (embolden) + FT_GlyphSlot_Embolden(slot); if (obliquen) { - Q_FT_GLYPHSLOT_OBLIQUE(slot); + FT_GlyphSlot_Oblique(slot); // While Embolden alters the metrics of the slot, oblique does not, so we need // to fix this ourselves. @@ -1482,8 +1449,10 @@ void QFontEngineFT::addGlyphsToPath(glyph_t *glyphs, QFixedPoint *positions, int FT_GlyphSlot g = face->glyph; if (g->format != FT_GLYPH_FORMAT_OUTLINE) continue; - if (embolden) Q_FT_GLYPHSLOT_EMBOLDEN(g); - if (obliquen) Q_FT_GLYPHSLOT_OBLIQUE(g); + if (embolden) + FT_GlyphSlot_Embolden(g); + if (obliquen) + FT_GlyphSlot_Oblique(g); QFreetypeFace::addGlyphToPath(face, g, positions[gl], path, xsize, ysize); } unlockFace(); diff --git a/src/gui/text/qharfbuzzng.cpp b/src/gui/text/qharfbuzzng.cpp index 16c45e642b..5a442a0eb5 100644 --- a/src/gui/text/qharfbuzzng.cpp +++ b/src/gui/text/qharfbuzzng.cpp @@ -375,7 +375,7 @@ _hb_qt_font_get_glyph(hb_font_t * /*font*/, void *font_data, hb_codepoint_t *glyph, void * /*user_data*/) { - QFontEngine *fe = (QFontEngine *)font_data; + QFontEngine *fe = static_cast<QFontEngine *>(font_data); Q_ASSERT(fe); *glyph = fe->glyphIndex(unicode); @@ -388,7 +388,7 @@ _hb_qt_font_get_glyph_h_advance(hb_font_t *font, void *font_data, hb_codepoint_t glyph, void * /*user_data*/) { - QFontEngine *fe = (QFontEngine *)font_data; + QFontEngine *fe = static_cast<QFontEngine *>(font_data); Q_ASSERT(fe); QFixed advance; @@ -436,7 +436,7 @@ _hb_qt_font_get_glyph_h_kerning(hb_font_t *font, void *font_data, hb_codepoint_t first_glyph, hb_codepoint_t second_glyph, void * /*user_data*/) { - QFontEngine *fe = (QFontEngine *)font_data; + QFontEngine *fe = static_cast<QFontEngine *>(font_data); Q_ASSERT(fe); glyph_t glyphs[2] = { first_glyph, second_glyph }; @@ -467,7 +467,7 @@ _hb_qt_font_get_glyph_extents(hb_font_t * /*font*/, void *font_data, hb_glyph_extents_t *extents, void * /*user_data*/) { - QFontEngine *fe = (QFontEngine *)font_data; + QFontEngine *fe = static_cast<QFontEngine *>(font_data); Q_ASSERT(fe); glyph_metrics_t gm = fe->boundingBox(glyph); @@ -486,7 +486,7 @@ _hb_qt_font_get_glyph_contour_point(hb_font_t * /*font*/, void *font_data, unsigned int point_index, hb_position_t *x, hb_position_t *y, void * /*user_data*/) { - QFontEngine *fe = (QFontEngine *)font_data; + QFontEngine *fe = static_cast<QFontEngine *>(font_data); Q_ASSERT(fe); QFixed xpos, ypos; @@ -573,7 +573,7 @@ hb_font_funcs_t *hb_qt_get_font_funcs() static hb_blob_t * _hb_qt_reference_table(hb_face_t * /*face*/, hb_tag_t tag, void *user_data) { - QFontEngine::FaceData *data = (QFontEngine::FaceData *)user_data; + QFontEngine::FaceData *data = static_cast<QFontEngine::FaceData *>(user_data); Q_ASSERT(data); qt_get_font_table_func_t get_font_table = data->get_font_table; @@ -583,21 +583,21 @@ _hb_qt_reference_table(hb_face_t * /*face*/, hb_tag_t tag, void *user_data) if (Q_UNLIKELY(!get_font_table(data->user_data, tag, 0, &length))) return hb_blob_get_empty(); - char *buffer = (char *)malloc(length); + char *buffer = static_cast<char *>(malloc(length)); Q_CHECK_PTR(buffer); if (Q_UNLIKELY(!get_font_table(data->user_data, tag, reinterpret_cast<uchar *>(buffer), &length))) length = 0; return hb_blob_create(const_cast<const char *>(buffer), length, - HB_MEMORY_MODE_WRITABLE, + HB_MEMORY_MODE_READONLY, buffer, free); } static inline hb_face_t * _hb_qt_face_create(QFontEngine *fe) { - QFontEngine::FaceData *data = (QFontEngine::FaceData *)malloc(sizeof(QFontEngine::FaceData)); + QFontEngine::FaceData *data = static_cast<QFontEngine::FaceData *>(malloc(sizeof(QFontEngine::FaceData))); Q_CHECK_PTR(data); data->user_data = fe->faceData.user_data; data->get_font_table = fe->faceData.get_font_table; @@ -618,7 +618,7 @@ static void _hb_qt_face_release(void *user_data) { if (Q_LIKELY(user_data)) - hb_face_destroy((hb_face_t *)user_data); + hb_face_destroy(static_cast<hb_face_t *>(user_data)); } hb_face_t *hb_qt_face_get_for_engine(QFontEngine *fe) @@ -632,7 +632,7 @@ hb_face_t *hb_qt_face_get_for_engine(QFontEngine *fe) fe->face_destroy_func = _hb_qt_face_release; } - return (hb_face_t *)fe->face_; + return static_cast<hb_face_t *>(fe->face_); } @@ -668,7 +668,7 @@ static void _hb_qt_font_release(void *user_data) { if (Q_LIKELY(user_data)) - hb_font_destroy((hb_font_t *)user_data); + hb_font_destroy(static_cast<hb_font_t *>(user_data)); } hb_font_t *hb_qt_font_get_for_engine(QFontEngine *fe) @@ -682,7 +682,7 @@ hb_font_t *hb_qt_font_get_for_engine(QFontEngine *fe) fe->font_destroy_func = _hb_qt_font_release; } - return (hb_font_t *)fe->font_; + return static_cast<hb_font_t *>(fe->font_); } QT_END_NAMESPACE diff --git a/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglnativeinterfacehandler.cpp b/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglnativeinterfacehandler.cpp index e65a7bb085..9d06502158 100644 --- a/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglnativeinterfacehandler.cpp +++ b/src/plugins/platforms/xcb/gl_integrations/xcb_egl/qxcbeglnativeinterfacehandler.cpp @@ -116,8 +116,9 @@ void *QXcbEglNativeInterfaceHandler::eglDisplay() void *QXcbEglNativeInterfaceHandler::eglDisplayForWindow(QWindow *window) { Q_ASSERT(window); - Q_ASSERT(window->handle()); - if (window->supportsOpenGL()) + if (window->supportsOpenGL() && window->handle() == Q_NULLPTR) + return eglDisplay(); + else if (window->supportsOpenGL()) return static_cast<QXcbEglWindow *>(window->handle())->glIntegration()->eglDisplay(); return Q_NULLPTR; } diff --git a/src/sql/drivers/mysql/qsql_mysql.cpp b/src/sql/drivers/mysql/qsql_mysql.cpp index db54ce84da..9fd7e2b57f 100644 --- a/src/sql/drivers/mysql/qsql_mysql.cpp +++ b/src/sql/drivers/mysql/qsql_mysql.cpp @@ -670,6 +670,8 @@ QVariant QMYSQLResult::data(int field) bool QMYSQLResult::isNull(int field) { + if (field < 0 || field >= d->fields.count()) + return true; if (d->preparedQuery) return d->fields.at(field).nullIndicator; else |