summaryrefslogtreecommitdiffstats
path: root/src/gui/painting
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2013-11-26 22:30:27 +0100
committerFrederik Gladhorn <frederik.gladhorn@digia.com>2013-11-26 22:35:48 +0100
commit4a8273a6fc2e741e811cf5dabc9a3c240306cf7f (patch)
tree2148abc88f8543eecdc0b97b2dd92594836af9b2 /src/gui/painting
parent036c5db468164297d213764c59a4b59daa76d90a (diff)
parent1c2be58fecaff1de5f2849192eb712984ebd59bd (diff)
Merge remote-tracking branch 'origin/stable' into dev
For the conflicts in msvc_nmake.cpp the ifdefs are extended since we need to support windows phone in the target branch while it is not there in the current stable branch (as of Qt 5.2). Conflicts: configure qmake/generators/win32/msvc_nmake.cpp src/3rdparty/angle/src/libEGL/Surface.cpp src/angle/src/common/common.pri src/corelib/global/qglobal.h src/corelib/io/qstandardpaths.cpp src/plugins/platforms/qnx/qqnxintegration.cpp src/plugins/platforms/qnx/qqnxscreeneventhandler.h src/plugins/platforms/xcb/qglxintegration.h src/widgets/kernel/win.pri tests/auto/corelib/thread/qreadwritelock/tst_qreadwritelock.cpp tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp tools/configure/configureapp.cpp Change-Id: I00b579eefebaf61d26ab9b00046d2b5bd5958812
Diffstat (limited to 'src/gui/painting')
-rw-r--r--src/gui/painting/qbrush.cpp4
-rw-r--r--src/gui/painting/qdrawhelper_neon.cpp1
-rw-r--r--src/gui/painting/qpaintengine.h6
-rw-r--r--src/gui/painting/qpaintengine_raster.cpp16
-rw-r--r--src/gui/painting/qpainter.cpp7
-rw-r--r--src/gui/painting/qpdf.cpp2
-rw-r--r--src/gui/painting/qtextureglyphcache.cpp12
7 files changed, 25 insertions, 23 deletions
diff --git a/src/gui/painting/qbrush.cpp b/src/gui/painting/qbrush.cpp
index 38c2dd6498..b35fa38ce0 100644
--- a/src/gui/painting/qbrush.cpp
+++ b/src/gui/painting/qbrush.cpp
@@ -508,7 +508,7 @@ QBrush::QBrush(Qt::GlobalColor color, Qt::BrushStyle style)
The style is set to Qt::TexturePattern. The color will only have
an effect for QBitmaps.
- \sa setColor(), setPixmap()
+ \sa setColor(), setTexture()
*/
QBrush::QBrush(const QColor &color, const QPixmap &pixmap)
@@ -525,7 +525,7 @@ QBrush::QBrush(const QColor &color, const QPixmap &pixmap)
The style is set to Qt::TexturePattern. The color will only have
an effect for QBitmaps.
- \sa setColor(), setPixmap()
+ \sa setColor(), setTexture()
*/
QBrush::QBrush(Qt::GlobalColor color, const QPixmap &pixmap)
{
diff --git a/src/gui/painting/qdrawhelper_neon.cpp b/src/gui/painting/qdrawhelper_neon.cpp
index b12fd71563..541b3ef619 100644
--- a/src/gui/painting/qdrawhelper_neon.cpp
+++ b/src/gui/painting/qdrawhelper_neon.cpp
@@ -964,6 +964,7 @@ public:
union Vect_buffer_i { Int32x4 v; int i[4]; };
union Vect_buffer_f { Float32x4 v; float f[4]; };
+ static inline Float32x4 v_dup(double x) { return vdupq_n_f32(float(x)); }
static inline Float32x4 v_dup(float x) { return vdupq_n_f32(x); }
static inline Int32x4 v_dup(int x) { return vdupq_n_s32(x); }
static inline Int32x4 v_dup(uint x) { return vdupq_n_s32(x); }
diff --git a/src/gui/painting/qpaintengine.h b/src/gui/painting/qpaintengine.h
index b4dec2929d..18b6d84146 100644
--- a/src/gui/painting/qpaintengine.h
+++ b/src/gui/painting/qpaintengine.h
@@ -247,12 +247,6 @@ private:
friend class QFontEngineBox;
friend class QFontEngineMac;
friend class QFontEngineWin;
-#ifndef QT_NO_QWS_QPF
- friend class QFontEngineQPF1;
-#endif
-#ifndef QT_NO_QWS_QPF2
- friend class QFontEngineQPF;
-#endif
friend class QMacPrintEngine;
friend class QMacPrintEnginePrivate;
friend class QFontEngineQPA;
diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp
index 4a26da104d..bdd0d9cd4c 100644
--- a/src/gui/painting/qpaintengine_raster.cpp
+++ b/src/gui/painting/qpaintengine_raster.cpp
@@ -308,9 +308,9 @@ QRasterPaintEnginePrivate::QRasterPaintEnginePrivate() :
of painting operations in Qt for Embedded Linux.
Note that this functionality is only available in
- \l{Qt for Embedded Linux}.
+ Qt for Embedded Linux.
- In \l{Qt for Embedded Linux}, painting is a pure software
+ In Qt for Embedded Linux, painting is a pure software
implementation. But starting with Qt 4.2, it is
possible to add an accelerated graphics driver to take advantage
of available hardware resources.
@@ -318,19 +318,15 @@ QRasterPaintEnginePrivate::QRasterPaintEnginePrivate() :
Hardware acceleration is accomplished by creating a custom screen
driver, accelerating the copying from memory to the screen, and
implementing a custom paint engine accelerating the various
- painting operations. Then a custom paint device (derived from the
- QCustomRasterPaintDevice class) and a custom window surface
- (derived from QWSWindowSurface) must be implemented to make
- \l{Qt for Embedded Linux} aware of the accelerated driver.
+ painting operations. Then a custom paint device and a custom
+ window surface must be implemented to make
+ Qt for Embedded Linux aware of the accelerated driver.
\note The QRasterPaintEngine class does not support 8-bit images.
Instead, they need to be converted to a supported format, such as
QImage::Format_ARGB32_Premultiplied.
- See the \l {Adding an Accelerated Graphics Driver to Qt for Embedded Linux}
- documentation for details.
-
- \sa QCustomRasterPaintDevice, QPaintEngine
+ \sa QPaintEngine
*/
/*!
diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp
index 4c02abdfd5..424ed554a2 100644
--- a/src/gui/painting/qpainter.cpp
+++ b/src/gui/painting/qpainter.cpp
@@ -146,17 +146,16 @@ static inline uint line_emulation(uint emulation)
}
#ifndef QT_NO_DEBUG
-static bool qt_painter_thread_test(int devType, const char *what, bool extraCondition = false)
+static bool qt_painter_thread_test(int devType, const char *what)
{
switch (devType) {
case QInternal::Image:
case QInternal::Printer:
case QInternal::Picture:
// can be drawn onto these devices safely from any thread
- if (extraCondition)
- break;
+ break;
default:
- if (!extraCondition && QThread::currentThread() != qApp->thread()) {
+ if (QThread::currentThread() != qApp->thread()) {
qWarning("QPainter: It is not safe to use %s outside the GUI thread", what);
return false;
}
diff --git a/src/gui/painting/qpdf.cpp b/src/gui/painting/qpdf.cpp
index 9105e8b396..c05f47c59d 100644
--- a/src/gui/painting/qpdf.cpp
+++ b/src/gui/painting/qpdf.cpp
@@ -1651,7 +1651,7 @@ void QPdfEnginePrivate::writeInfo()
xprintf("\n/Creator ");
printString(creator);
xprintf("\n/Producer ");
- printString(QString::fromLatin1("Qt " QT_VERSION_STR " (C) 2012 Digia Plc and/or its subsidiary(-ies)"));
+ printString(QString::fromLatin1("Qt " QT_VERSION_STR));
QDateTime now = QDateTime::currentDateTime().toUTC();
QTime t = now.time();
QDate d = now.date();
diff --git a/src/gui/painting/qtextureglyphcache.cpp b/src/gui/painting/qtextureglyphcache.cpp
index 2166ae7975..b953f8d81f 100644
--- a/src/gui/painting/qtextureglyphcache.cpp
+++ b/src/gui/painting/qtextureglyphcache.cpp
@@ -152,6 +152,18 @@ bool QTextureGlyphCache::populate(QFontEngine *fontEngine, int numGlyphs, const
continue;
if (listItemCoordinates.contains(GlyphAndSubPixelPosition(glyph, subPixelPosition)))
continue;
+
+ // This is a rather crude hack, but it works.
+ // The FreeType font engine is not capable of getting precise metrics for the alphamap
+ // without first rasterizing the glyph. If we force the glyph to be rasterized before
+ // we ask for the alphaMapBoundingBox(), the glyph will be loaded, rasterized and its
+ // proper metrics will be cached and used later.
+ if (fontEngine->hasInternalCaching()) {
+ QImage *locked = fontEngine->lockedAlphaMapForGlyph(glyph, subPixelPosition, format);
+ if (locked)
+ fontEngine->unlockAlphaMapForGlyph();
+ }
+
glyph_metrics_t metrics = fontEngine->alphaMapBoundingBox(glyph, subPixelPosition, m_transform, format);
#ifdef CACHE_DEBUG