summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorJørgen Lind <jorgen.lind@nokia.com>2011-06-27 12:27:54 +0200
committerJørgen Lind <jorgen.lind@nokia.com>2011-06-27 12:27:54 +0200
commit18a3f6169bb8a763366003d92b8013950578c79f (patch)
treee39fa00a9511410fea9be35a6130007e43719ad8 /src/gui
parent371d398f70e10408e0eaba7b5f05e638a0048599 (diff)
parenta06c8405d053b16327d65415f3335eceb37abd3b (diff)
Merge remote-tracking branch 'base/master' into refactor
Conflicts: demos/demos.pro demos/embedded/digiflip/digiflip.pro examples/examples.pro examples/graphicsview/embeddeddialogs/embeddeddialogs.pro src/gui/kernel/qplatformglcontext_qpa.cpp src/plugins/platforms/wayland/gl_integration/xcomposite_egl/qwaylandxcompositeeglcontext.cpp src/plugins/platforms/wayland/gl_integration/xcomposite_glx/qwaylandxcompositeglxcontext.cpp src/plugins/platforms/wayland/qwaylanddisplay.cpp src/plugins/platforms/wayland/qwaylandwindow.cpp Change-Id: I2a4ec9e2ca9c9aa9d57b55f98985e810b77bb745
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/painting/qcosmeticstroker.cpp45
-rw-r--r--src/gui/painting/qcosmeticstroker_p.h41
-rw-r--r--src/gui/painting/qpaintengine_raster.cpp7
-rw-r--r--src/gui/painting/qpaintengineex.cpp9
-rw-r--r--src/gui/text/qfont.cpp1
-rw-r--r--src/gui/text/qfont_p.h3
-rw-r--r--src/gui/text/qfontdatabase.cpp2
-rw-r--r--src/gui/text/qharfbuzz_copy_p.h8
-rw-r--r--src/gui/text/qtextdocument.cpp2
-rw-r--r--src/gui/text/qtextdocumentfragment.cpp9
-rw-r--r--src/gui/text/qtextdocumentfragment_p.h2
-rw-r--r--src/gui/text/qtextlayout.cpp4
12 files changed, 108 insertions, 25 deletions
diff --git a/src/gui/painting/qcosmeticstroker.cpp b/src/gui/painting/qcosmeticstroker.cpp
index 3ee262fcf1..d694b4b9a8 100644
--- a/src/gui/painting/qcosmeticstroker.cpp
+++ b/src/gui/painting/qcosmeticstroker.cpp
@@ -1,3 +1,44 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtGui module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
#include "qcosmeticstroker_p.h"
#include "private/qpainterpath_p.h"
#include <qdebug.h>
@@ -99,6 +140,10 @@ static void drawLineAA(QCosmeticStroker *stroker, qreal x1, qreal y1, qreal x2,
inline void drawPixel(QCosmeticStroker *stroker, int x, int y, int coverage)
{
+ const QRect &cl = stroker->clip;
+ if (x < cl.x() || x > cl.right() || y < cl.y() || y > cl.bottom())
+ return;
+
int lastx = stroker->spans[stroker->current_span-1].x + stroker->spans[stroker->current_span-1].len ;
int lasty = stroker->spans[stroker->current_span-1].y;
diff --git a/src/gui/painting/qcosmeticstroker_p.h b/src/gui/painting/qcosmeticstroker_p.h
index 1355a5ad13..0aa71fc9cd 100644
--- a/src/gui/painting/qcosmeticstroker_p.h
+++ b/src/gui/painting/qcosmeticstroker_p.h
@@ -1,3 +1,44 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtGui module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
#ifndef QCOSMETICSTROKER_P_H
#define QCOSMETICSTROKER_P_H
diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp
index 62004c965b..e9a3b7a16c 100644
--- a/src/gui/painting/qpaintengine_raster.cpp
+++ b/src/gui/painting/qpaintengine_raster.cpp
@@ -2002,15 +2002,8 @@ void QRasterPaintEngine::drawPolygon(const QPoint *points, int pointCount, Polyg
if (s->penData.blend) {
int count = pointCount * 2;
QVarLengthArray<qreal> fpoints(count);
- #ifdef Q_WS_MAC
- for (int i=0; i<count; i+=2) {
- fpoints[i] = ((int *) points)[i+1];
- fpoints[i+1] = ((int *) points)[i];
- }
- #else
for (int i=0; i<count; ++i)
fpoints[i] = ((int *) points)[i];
- #endif
QVectorPath vp((qreal *) fpoints.data(), pointCount, 0, QVectorPath::polygonFlags(mode));
if (s->flags.fast_pen) {
diff --git a/src/gui/painting/qpaintengineex.cpp b/src/gui/painting/qpaintengineex.cpp
index 8510416fcb..9427dd5105 100644
--- a/src/gui/painting/qpaintengineex.cpp
+++ b/src/gui/painting/qpaintengineex.cpp
@@ -789,15 +789,8 @@ void QPaintEngineEx::drawLines(const QLine *lines, int lineCount)
qreal pts[64];
int count2 = count<<1;
-#ifdef Q_WS_MAC
- for (int i=0; i<count2; i+=2) {
- pts[i] = ((int *) lines)[i+1];
- pts[i+1] = ((int *) lines)[i];
- }
-#else
for (int i=0; i<count2; ++i)
pts[i] = ((int *) lines)[i];
-#endif
QVectorPath path(pts, count, qpaintengineex_line_types_16, QVectorPath::LinesHint);
stroke(path, state()->pen);
@@ -1084,7 +1077,7 @@ void QPaintEngineEx::drawStaticTextItem(QStaticTextItem *staticTextItem)
changedHints = true;
}
- fill(qtVectorPathForPath(path), staticTextItem->color);
+ fill(qtVectorPathForPath(path), s->pen.color());
if (changedHints) {
s->renderHints = oldHints;
diff --git a/src/gui/text/qfont.cpp b/src/gui/text/qfont.cpp
index 8b78b52c08..846d5a3814 100644
--- a/src/gui/text/qfont.cpp
+++ b/src/gui/text/qfont.cpp
@@ -140,6 +140,7 @@ bool QFontDef::exactMatch(const QFontDef &other) const
&& weight == other.weight
&& style == other.style
&& this_family == other_family
+ && styleName == other.styleName
&& (this_foundry.isEmpty()
|| other_foundry.isEmpty()
|| this_foundry == other_foundry)
diff --git a/src/gui/text/qfont_p.h b/src/gui/text/qfont_p.h
index 8eeae6ffc1..4ae31c38d6 100644
--- a/src/gui/text/qfont_p.h
+++ b/src/gui/text/qfont_p.h
@@ -113,6 +113,7 @@ struct QFontDef
&& styleStrategy == other.styleStrategy
&& ignorePitch == other.ignorePitch && fixedPitch == other.fixedPitch
&& family == other.family
+ && styleName == other.styleName
&& hintingPreference == other.hintingPreference
#ifdef Q_WS_X11
&& addStyle == other.addStyle
@@ -128,6 +129,8 @@ struct QFontDef
if (styleHint != other.styleHint) return styleHint < other.styleHint;
if (styleStrategy != other.styleStrategy) return styleStrategy < other.styleStrategy;
if (family != other.family) return family < other.family;
+ if (!styleName.isEmpty() && !other.styleName.isEmpty() && styleName != other.styleName)
+ return styleName < other.styleName;
if (hintingPreference != other.hintingPreference) return hintingPreference < other.hintingPreference;
#ifdef Q_WS_X11
diff --git a/src/gui/text/qfontdatabase.cpp b/src/gui/text/qfontdatabase.cpp
index ad8c6c9ab5..5369ac52f3 100644
--- a/src/gui/text/qfontdatabase.cpp
+++ b/src/gui/text/qfontdatabase.cpp
@@ -1123,13 +1123,13 @@ QT_BEGIN_INCLUDE_NAMESPACE
#elif defined(Q_OS_SYMBIAN)
# include "qfontdatabase_s60.cpp"
#endif
+QT_END_INCLUDE_NAMESPACE
#if !defined(Q_WS_X11)
QString QFontDatabase::resolveFontFamilyAlias(const QString &family)
{
return family;
}
#endif
-QT_END_INCLUDE_NAMESPACE
static QtFontStyle *bestStyle(QtFontFoundry *foundry, const QtFontStyle::Key &styleKey)
{
diff --git a/src/gui/text/qharfbuzz_copy_p.h b/src/gui/text/qharfbuzz_copy_p.h
index 74b824ab35..835d8fb1a6 100644
--- a/src/gui/text/qharfbuzz_copy_p.h
+++ b/src/gui/text/qharfbuzz_copy_p.h
@@ -43,7 +43,7 @@ extern "C" {
#ifdef __xlC__
typedef unsigned hb_bitfield;
#else
-typedef quint8 hb_bitfield;
+typedef QT_PREPEND_NAMESPACE(quint8) hb_bitfield;
#endif
typedef enum {
@@ -66,12 +66,12 @@ typedef enum {
HB_Err_Out_Of_Memory = 0xDEAD
} HB_Error;
-typedef quint32 HB_Glyph;
+typedef QT_PREPEND_NAMESPACE(quint32) HB_Glyph;
typedef void * HB_Font;
typedef void * HB_Face;
typedef void * HB_FontRec;
-typedef quint32 hb_uint32;
-typedef qint32 HB_Fixed;
+typedef QT_PREPEND_NAMESPACE(quint32) hb_uint32;
+typedef QT_PREPEND_NAMESPACE(qint32) HB_Fixed;
typedef struct {
HB_Fixed x;
diff --git a/src/gui/text/qtextdocument.cpp b/src/gui/text/qtextdocument.cpp
index 3ca72bf14e..a488c13156 100644
--- a/src/gui/text/qtextdocument.cpp
+++ b/src/gui/text/qtextdocument.cpp
@@ -2710,6 +2710,8 @@ void QTextHtmlExporter::emitBlock(const QTextBlock &block)
emitBlockAttributes(block);
html += QLatin1Char('>');
+ if (block.begin().atEnd())
+ html += "<br />";
QTextBlock::Iterator it = block.begin();
if (fragmentMarkers && !it.atEnd() && block == doc->begin())
diff --git a/src/gui/text/qtextdocumentfragment.cpp b/src/gui/text/qtextdocumentfragment.cpp
index 042b1d01c2..0c8860e98e 100644
--- a/src/gui/text/qtextdocumentfragment.cpp
+++ b/src/gui/text/qtextdocumentfragment.cpp
@@ -545,8 +545,13 @@ void QTextHtmlImporter::import()
}
if (currentNode->isBlock()) {
- if (processBlockNode() == ContinueWithNextNode)
+ QTextHtmlImporter::ProcessNodeResult result = processBlockNode();
+ if (result == ContinueWithNextNode) {
continue;
+ } else if (result == ContinueWithNextSibling) {
+ currentNodeIdx += currentNode->children.size();
+ continue;
+ }
}
if (currentNode->charFormat.isAnchor() && !currentNode->charFormat.anchorName().isEmpty()) {
@@ -1157,7 +1162,7 @@ QTextHtmlImporter::ProcessNodeResult QTextHtmlImporter::processBlockNode()
if (currentNode->isEmptyParagraph) {
hasBlock = false;
- return ContinueWithNextNode;
+ return ContinueWithNextSibling;
}
hasBlock = true;
diff --git a/src/gui/text/qtextdocumentfragment_p.h b/src/gui/text/qtextdocumentfragment_p.h
index bfbec3075c..227123ed80 100644
--- a/src/gui/text/qtextdocumentfragment_p.h
+++ b/src/gui/text/qtextdocumentfragment_p.h
@@ -135,7 +135,7 @@ private:
Table scanTable(int tableNodeIdx);
- enum ProcessNodeResult { ContinueWithNextNode, ContinueWithCurrentNode };
+ enum ProcessNodeResult { ContinueWithNextNode, ContinueWithCurrentNode, ContinueWithNextSibling };
void appendBlock(const QTextBlockFormat &format, QTextCharFormat charFmt = QTextCharFormat());
bool appendNodeText();
diff --git a/src/gui/text/qtextlayout.cpp b/src/gui/text/qtextlayout.cpp
index e386b5eb1f..03e00ed0df 100644
--- a/src/gui/text/qtextlayout.cpp
+++ b/src/gui/text/qtextlayout.cpp
@@ -2149,7 +2149,7 @@ QList<QGlyphRun> QTextLine::glyphRuns(int from, int length) const
}
int relativeFrom = qMax(iterator.itemStart, from) - si.position;
- int relativeTo = qMin(iterator.itemEnd, from + length - 1) - si.position;
+ int relativeTo = qMin(iterator.itemEnd - 1, from + length - 1) - si.position;
unsigned short *logClusters = eng->logClusters(&si);
int glyphsStart = logClusters[relativeFrom];
@@ -2168,7 +2168,7 @@ QList<QGlyphRun> QTextLine::glyphRuns(int from, int length) const
pos += QPointF((glyphLayout.advances_x[i] + justification).toReal(),
glyphLayout.advances_y[i].toReal());
}
- } else if (relativeTo != (iterator.itemEnd - si.position) && rtl) {
+ } else if (relativeTo != (iterator.itemEnd - si.position - 1) && rtl) {
for (int i=glyphLayout.numGlyphs - 1; i>glyphsEnd; --i) {
QFixed justification = QFixed::fromFixed(glyphLayout.justifications[i].space_18d6);
pos += QPointF((glyphLayout.advances_x[i] + justification).toReal(),