summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/corelib/kernel/kernel.pri10
-rw-r--r--src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm9
-rw-r--r--src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm5
-rw-r--r--src/plugins/platforms/direct2d/qwindowsdirect2dcontext.cpp5
-rw-r--r--src/plugins/platforms/direct2d/qwindowsdirect2dpaintengine.cpp3
-rw-r--r--src/plugins/platforms/qnx/qnx.pro20
-rw-r--r--src/plugins/platforms/qnx/qqnxbuttoneventnotifier.cpp2
-rw-r--r--src/plugins/platforms/qnx/qqnxintegration.cpp4
-rw-r--r--src/plugins/platforms/qnx/qqnxnavigatoreventnotifier.cpp3
-rw-r--r--src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp21
-rw-r--r--src/plugins/platforms/qnx/qqnxvirtualkeyboardpps.cpp30
-rw-r--r--src/plugins/platforms/windows/qwindowsmousehandler.cpp2
12 files changed, 72 insertions, 42 deletions
diff --git a/src/corelib/kernel/kernel.pri b/src/corelib/kernel/kernel.pri
index 1fec528b31..819c10e99f 100644
--- a/src/corelib/kernel/kernel.pri
+++ b/src/corelib/kernel/kernel.pri
@@ -164,11 +164,17 @@ vxworks {
blackberry {
SOURCES += \
- kernel/qeventdispatcher_blackberry.cpp \
+ kernel/qeventdispatcher_blackberry.cpp
+ HEADERS += \
+ kernel/qeventdispatcher_blackberry_p.h
+}
+
+qqnx_pps {
+ LIBS_PRIVATE += -lpps
+ SOURCES += \
kernel/qppsattribute.cpp \
kernel/qppsobject.cpp
HEADERS += \
- kernel/qeventdispatcher_blackberry_p.h \
kernel/qppsattribute_p.h \
kernel/qppsattributeprivate_p.h \
kernel/qppsobject_p.h \
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<CFArrayRef> 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
}
}
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));
diff --git a/src/plugins/platforms/direct2d/qwindowsdirect2dcontext.cpp b/src/plugins/platforms/direct2d/qwindowsdirect2dcontext.cpp
index 1ea90c4f91..d757789935 100644
--- a/src/plugins/platforms/direct2d/qwindowsdirect2dcontext.cpp
+++ b/src/plugins/platforms/direct2d/qwindowsdirect2dcontext.cpp
@@ -90,7 +90,7 @@ public:
return false;
}
- ComPtr<IDXGIDevice> dxgiDevice;
+ ComPtr<IDXGIDevice1> dxgiDevice;
ComPtr<IDXGIAdapter> dxgiAdapter;
hr = d3dDevice.As(&dxgiDevice);
@@ -99,6 +99,9 @@ public:
return false;
}
+ // Ensure that DXGI doesn't queue more than one frame at a time.
+ dxgiDevice->SetMaximumFrameLatency(1);
+
hr = dxgiDevice->GetAdapter(&dxgiAdapter);
if (FAILED(hr)) {
qWarning("%s: Failed to probe DXGI Device for parent DXGI Adapter: %#x", __FUNCTION__, hr);
diff --git a/src/plugins/platforms/direct2d/qwindowsdirect2dpaintengine.cpp b/src/plugins/platforms/direct2d/qwindowsdirect2dpaintengine.cpp
index 6e8d9b0baf..ca2dcf908d 100644
--- a/src/plugins/platforms/direct2d/qwindowsdirect2dpaintengine.cpp
+++ b/src/plugins/platforms/direct2d/qwindowsdirect2dpaintengine.cpp
@@ -382,8 +382,7 @@ public:
inline D2D1_INTERPOLATION_MODE interpolationMode() const
{
Q_Q(const QWindowsDirect2DPaintEngine);
- // XXX are we choosing the right d2d interpolation modes?
- return (q->state()->renderHints & QPainter::SmoothPixmapTransform) ? D2D1_INTERPOLATION_MODE_HIGH_QUALITY_CUBIC
+ return (q->state()->renderHints & QPainter::SmoothPixmapTransform) ? D2D1_INTERPOLATION_MODE_LINEAR
: D2D1_INTERPOLATION_MODE_NEAREST_NEIGHBOR;
}
diff --git a/src/plugins/platforms/qnx/qnx.pro b/src/plugins/platforms/qnx/qnx.pro
index 856b7d2abe..b5c6b48931 100644
--- a/src/plugins/platforms/qnx/qnx.pro
+++ b/src/plugins/platforms/qnx/qnx.pro
@@ -121,18 +121,22 @@ CONFIG(blackberry-playbook) {
CONFIG(qqnx_pps) {
DEFINES += QQNX_PPS
- SOURCES += qqnxnavigatorpps.cpp \
- qqnxnavigatoreventnotifier.cpp \
- qqnxvirtualkeyboardpps.cpp \
- qqnxclipboard.cpp \
+ SOURCES += qqnxclipboard.cpp \
qqnxbuttoneventnotifier.cpp
- HEADERS += qqnxnavigatorpps.h \
- qqnxnavigatoreventnotifier.h \
- qqnxvirtualkeyboardpps.h \
- qqnxclipboard.h \
+ HEADERS += qqnxclipboard.h \
qqnxbuttoneventnotifier.h
+ !blackberry {
+ SOURCES += qqnxnavigatorpps.cpp \
+ qqnxnavigatoreventnotifier.cpp \
+ qqnxvirtualkeyboardpps.cpp
+
+ HEADERS += qqnxnavigatorpps.h \
+ qqnxnavigatoreventnotifier.h \
+ qqnxvirtualkeyboardpps.h
+ }
+
LIBS += -lpps
!contains(DEFINES, QT_NO_CLIPBOARD): LIBS += -lclipboard
diff --git a/src/plugins/platforms/qnx/qqnxbuttoneventnotifier.cpp b/src/plugins/platforms/qnx/qqnxbuttoneventnotifier.cpp
index 2f531efd8b..d3f843ac39 100644
--- a/src/plugins/platforms/qnx/qqnxbuttoneventnotifier.cpp
+++ b/src/plugins/platforms/qnx/qqnxbuttoneventnotifier.cpp
@@ -90,7 +90,9 @@ void QQnxButtonEventNotifier::start()
errno = 0;
m_fd = qt_safe_open(ppsPath, O_RDONLY);
if (m_fd == -1) {
+#if defined(Q_OS_BLACKBERRY) || defined (QQNXBUTTON_DEBUG)
qWarning("QQNX: failed to open buttons pps, errno=%d", errno);
+#endif
return;
}
diff --git a/src/plugins/platforms/qnx/qqnxintegration.cpp b/src/plugins/platforms/qnx/qqnxintegration.cpp
index 41ca2b5e18..1110eb5f28 100644
--- a/src/plugins/platforms/qnx/qqnxintegration.cpp
+++ b/src/plugins/platforms/qnx/qqnxintegration.cpp
@@ -67,12 +67,12 @@
#include "qqnxvirtualkeyboardbps.h"
#elif defined(QQNX_PPS)
#include "qqnxnavigatorpps.h"
+#include "qqnxnavigatoreventnotifier.h"
#include "qqnxvirtualkeyboardpps.h"
#endif
#if defined(QQNX_PPS)
# include "qqnxbuttoneventnotifier.h"
-# include "qqnxnavigatoreventnotifier.h"
# include "qqnxclipboard.h"
# if defined(QQNX_IMF)
@@ -284,7 +284,7 @@ QQnxIntegration::~QQnxIntegration()
#endif
// Stop/destroy navigator event notifier
-#if defined(QQNX_PPS)
+#if !defined(Q_OS_BLACKBERRY) && defined(QQNX_PPS)
delete m_navigatorEventNotifier;
#endif
delete m_navigatorEventHandler;
diff --git a/src/plugins/platforms/qnx/qqnxnavigatoreventnotifier.cpp b/src/plugins/platforms/qnx/qqnxnavigatoreventnotifier.cpp
index 640944fb45..8c8f1b2afe 100644
--- a/src/plugins/platforms/qnx/qqnxnavigatoreventnotifier.cpp
+++ b/src/plugins/platforms/qnx/qqnxnavigatoreventnotifier.cpp
@@ -93,7 +93,8 @@ void QQnxNavigatorEventNotifier::start()
errno = 0;
m_fd = open(navigatorControlPath, O_RDWR);
if (m_fd == -1) {
- qWarning("QQNX: failed to open navigator pps, errno=%d", errno);
+ qNavigatorEventNotifierDebug() << Q_FUNC_INFO << ": failed to open navigator pps:"
+ << strerror(errno);
return;
}
diff --git a/src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp b/src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp
index 57914cf2fb..3109388fb2 100644
--- a/src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp
+++ b/src/plugins/platforms/qnx/qqnxrasterbackingstore.cpp
@@ -41,6 +41,8 @@
#include "qqnxrasterbackingstore.h"
#include "qqnxrasterwindow.h"
+#include "qqnxscreen.h"
+#include "qqnxglobal.h"
#include <QtCore/QDebug>
@@ -167,6 +169,25 @@ void QQnxRasterBackingStore::beginPaint(const QRegion &region)
m_hasUnflushedPaintOperations = true;
platformWindow()->adjustBufferSize();
+
+ if (window()->requestedFormat().alphaBufferSize() != 0) {
+ foreach (const QRect &r, region.rects()) {
+ // Clear transparent regions
+ const int bg[] = {
+ SCREEN_BLIT_COLOR, 0x00000000,
+ SCREEN_BLIT_DESTINATION_X, r.x(),
+ SCREEN_BLIT_DESTINATION_Y, r.y(),
+ SCREEN_BLIT_DESTINATION_WIDTH, r.width(),
+ SCREEN_BLIT_DESTINATION_HEIGHT, r.height(),
+ SCREEN_BLIT_END
+ };
+ Q_SCREEN_CHECKERROR(screen_fill(platformWindow()->screen()->nativeContext(),
+ platformWindow()->renderBuffer().nativeBuffer(), bg),
+ "failed to clear transparent regions");
+ }
+ Q_SCREEN_CHECKERROR(screen_flush_blits(platformWindow()->screen()->nativeContext(), 0),
+ "failed to flush blits");
+ }
}
void QQnxRasterBackingStore::endPaint()
diff --git a/src/plugins/platforms/qnx/qqnxvirtualkeyboardpps.cpp b/src/plugins/platforms/qnx/qqnxvirtualkeyboardpps.cpp
index 2b6ee3d1dc..78180ec4a7 100644
--- a/src/plugins/platforms/qnx/qqnxvirtualkeyboardpps.cpp
+++ b/src/plugins/platforms/qnx/qqnxvirtualkeyboardpps.cpp
@@ -128,15 +128,16 @@ bool QQnxVirtualKeyboardPps::connect()
m_fd = ::open(ms_PPSPath, O_RDWR);
if (m_fd == -1)
{
- qCritical("QQnxVirtualKeyboard: Unable to open \"%s\" for keyboard: %s (%d).",
- ms_PPSPath, strerror(errno), errno);
+ qVirtualKeyboardDebug() << Q_FUNC_INFO << ": Unable to open" << ms_PPSPath
+ << ":" << strerror(errno);
close();
return false;
}
m_buffer = new char[ms_bufferSize];
if (!m_buffer) {
- qCritical("QQnxVirtualKeyboard: Unable to allocate buffer of %d bytes. Size is unavailable.", ms_bufferSize);
+ qCritical("QQnxVirtualKeyboard: Unable to allocate buffer of %d bytes. "
+ "Size is unavailable.", ms_bufferSize);
return false;
}
@@ -156,7 +157,7 @@ bool QQnxVirtualKeyboardPps::queryPPSInfo()
// Request info, requires id to regenerate res message.
pps_encoder_add_string(m_encoder, "msg", "info");
- pps_encoder_add_string(m_encoder, "id", "libWebView");
+ pps_encoder_add_string(m_encoder, "id", "1");
return writeCurrentPPSEncoder();
}
@@ -220,7 +221,6 @@ void QQnxVirtualKeyboardPps::ppsDataReady()
void QQnxVirtualKeyboardPps::handleKeyboardInfoMessage()
{
int newHeight = 0;
- const char *value;
if (pps_decoder_push(m_decoder, "dat") != PPS_DECODER_OK) {
qCritical("QQnxVirtualKeyboard: Keyboard PPS dat object not found");
@@ -230,27 +230,9 @@ void QQnxVirtualKeyboardPps::handleKeyboardInfoMessage()
qCritical("QQnxVirtualKeyboard: Keyboard PPS size field not found");
return;
}
- if (pps_decoder_push(m_decoder, "locale") != PPS_DECODER_OK) {
- qCritical("QQnxVirtualKeyboard: Keyboard PPS locale object not found");
- return;
- }
- if (pps_decoder_get_string(m_decoder, "languageId", &value) != PPS_DECODER_OK) {
- qCritical("QQnxVirtualKeyboard: Keyboard PPS languageId field not found");
- return;
- }
- const QString languageId = QString::fromLatin1(value);
- if (pps_decoder_get_string(m_decoder, "countryId", &value) != PPS_DECODER_OK) {
- qCritical("QQnxVirtualKeyboard: Keyboard PPS size countryId not found");
- return;
- }
- const QString countryId = QString::fromLatin1(value);
-
setHeight(newHeight);
- const QLocale locale = QLocale(languageId + QLatin1Char('_') + countryId);
- setLocale(locale);
-
- qVirtualKeyboardDebug() << Q_FUNC_INFO << "size=" << newHeight << "locale=" << locale;
+ qVirtualKeyboardDebug() << Q_FUNC_INFO << "size=" << newHeight;
}
bool QQnxVirtualKeyboardPps::showKeyboard()
diff --git a/src/plugins/platforms/windows/qwindowsmousehandler.cpp b/src/plugins/platforms/windows/qwindowsmousehandler.cpp
index dfa400285a..5c9add4baa 100644
--- a/src/plugins/platforms/windows/qwindowsmousehandler.cpp
+++ b/src/plugins/platforms/windows/qwindowsmousehandler.cpp
@@ -364,7 +364,7 @@ bool QWindowsMouseHandler::translateMouseWheelEvent(QWindow *window, HWND,
delta = (int) msg.wParam;
Qt::Orientation orientation = (msg.message == WM_MOUSEHWHEEL
- || (buttons & Qt::AltModifier)) ?
+ || (mods & Qt::AltModifier)) ?
Qt::Horizontal : Qt::Vertical;
// according to the MSDN documentation on WM_MOUSEHWHEEL: