From b6de758ec68a4df87b37d641357770d186022cdf Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Thu, 8 May 2014 16:36:51 +0200 Subject: Avoid using repeat on widget textures in eglfs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Otherwise widgets will not be shown on some embedded systems. Task-number: QTBUG-38866 Change-Id: Id16408dc7eb657c052bbe3bdb86e35ab2f062632 Reviewed-by: Jørgen Lind --- src/platformsupport/eglconvenience/qeglplatformbackingstore.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/platformsupport') diff --git a/src/platformsupport/eglconvenience/qeglplatformbackingstore.cpp b/src/platformsupport/eglconvenience/qeglplatformbackingstore.cpp index 24e9ccd39f..ab92bac37d 100644 --- a/src/platformsupport/eglconvenience/qeglplatformbackingstore.cpp +++ b/src/platformsupport/eglconvenience/qeglplatformbackingstore.cpp @@ -100,9 +100,8 @@ void QEGLPlatformBackingStore::updateTexture() glBindTexture(GL_TEXTURE_2D, m_bsTexture); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); - // QOpenGLTextureBlitter requires GL_REPEAT for the time being - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, m_image.width(), m_image.height(), 0, GL_RGBA, GL_UNSIGNED_BYTE, 0); } else { glBindTexture(GL_TEXTURE_2D, m_bsTexture); -- cgit v1.2.3 From a669564597f1d9aebe6f992d890b730c7be10f6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Wed, 30 Apr 2014 14:50:46 +0200 Subject: Allow QFont lookups using localized family names by adding family alias After fbaa6d3ca6fc269 QFont family names are non-localized on iOS/OS X, which means applications that try to initialize QFont with a localized family name (explicitly, or from user input), will fail, and get the fallback font instead. We now add font family aliases for the localized family names, so that font matching will work even for localized family names. Note that QFontDatabase::families() still returns a non-localized list. Task-number: QTBUG-38628 Change-Id: Id351befa69916ce162c939733bbfcc774f075120 Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/platformsupport') diff --git a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm index 1c0e888758..9248785696 100644 --- a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm +++ b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm @@ -196,13 +196,20 @@ void QCoreTextFontDatabase::populateFontDatabase() QCFType familyNames = availableFamilyNames(); const int numberOfFamilies = CFArrayGetCount(familyNames); for (int i = 0; i < numberOfFamilies; ++i) { - QString familyName = QCFString::toQString((CFStringRef) CFArrayGetValueAtIndex(familyNames, i)); + CFStringRef familyNameRef = (CFStringRef) CFArrayGetValueAtIndex(familyNames, i); + QString familyName = QCFString::toQString(familyNameRef); // Don't populate internal fonts if (familyName.startsWith(QLatin1Char('.')) || familyName == QStringLiteral("LastResort")) continue; QPlatformFontDatabase::registerFontFamily(familyName); + +#if defined(Q_OS_OSX) + QString localizedFamilyName = QString::fromNSString([[NSFontManager sharedFontManager] localizedNameForFamily:(NSString*)familyNameRef face:nil]); + if (familyName != localizedFamilyName) + QPlatformFontDatabase::registerAliasToFontFamily(familyName, localizedFamilyName); +#endif } } -- cgit v1.2.3 From 5a060a5ad322629f1a1ee0c850db94932543fee5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Wed, 30 Apr 2014 15:26:57 +0200 Subject: CoreText: Prevent creation of CGContext for glyphs with empty bounding box If the alphaMapBoundingBox of a glyph is empty we don't want to create a CGBitmapContext on it, as that will fail, and any further operations on the invalid context will result in possibly fatal errors from CG. This issue can be observed when drawing some glyphs of the Apple Color Emoji font. Change-Id: Ia45ba858b5fb6afa91e6d686a9c55e350d4095f3 Reviewed-by: Gunnar Sletta --- src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/platformsupport') diff --git a/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm b/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm index 0460f11139..6e2c8a2a9a 100644 --- a/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm +++ b/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm @@ -559,6 +559,9 @@ QImage QCoreTextFontEngine::imageForGlyph(glyph_t glyph, QFixed subPixelPosition QImage im(br.width.ceil().toInt(), br.height.ceil().toInt(), imageFormat); im.fill(0); + if (!im.width() || !im.height()) + return im; + #ifndef Q_OS_IOS CGColorSpaceRef colorspace = CGColorSpaceCreateWithName(kCGColorSpaceGenericRGB); #else @@ -568,9 +571,11 @@ QImage QCoreTextFontEngine::imageForGlyph(glyph_t glyph, QFixed subPixelPosition #ifdef kCGBitmapByteOrder32Host //only needed because CGImage.h added symbols in the minor version cgflags |= kCGBitmapByteOrder32Host; #endif + CGContextRef ctx = CGBitmapContextCreate(im.bits(), im.width(), im.height(), 8, im.bytesPerLine(), colorspace, cgflags); + Q_ASSERT(ctx); CGContextSetFontSize(ctx, fontDef.pixelSize); CGContextSetShouldAntialias(ctx, (aa || fontDef.pointSize > antialiasingThreshold) && !(fontDef.styleStrategy & QFont::NoAntialias)); -- cgit v1.2.3