gui: Pass large types by const-ref
sizeof: Operator : 144 QTransform : 88 QGlyphLayout : 48 QTextFrame::Iterator: 32 QRectF : 32 QCss::Value : 24 (Linux/x86_64) Change-Id: I4965bf0959683c0bc8909428fca86d66851af92c Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>bb10
parent
5dc13fe05e
commit
c4b52b42ab
|
|
@ -4026,7 +4026,7 @@ template<typename T>
|
|||
struct QBlendBase
|
||||
{
|
||||
typedef T BlendType;
|
||||
QBlendBase(QSpanData *d, Operator o)
|
||||
QBlendBase(QSpanData *d, const Operator &o)
|
||||
: data(d)
|
||||
, op(o)
|
||||
, dest(0)
|
||||
|
|
@ -4045,7 +4045,7 @@ struct QBlendBase
|
|||
class BlendSrcGeneric : public QBlendBase<uint>
|
||||
{
|
||||
public:
|
||||
BlendSrcGeneric(QSpanData *d, Operator o)
|
||||
BlendSrcGeneric(QSpanData *d, const Operator &o)
|
||||
: QBlendBase<uint>(d, o)
|
||||
{
|
||||
}
|
||||
|
|
@ -4071,7 +4071,7 @@ public:
|
|||
class BlendSrcGenericRGB64 : public QBlendBase<QRgba64>
|
||||
{
|
||||
public:
|
||||
BlendSrcGenericRGB64(QSpanData *d, Operator o)
|
||||
BlendSrcGenericRGB64(QSpanData *d, const Operator &o)
|
||||
: QBlendBase<QRgba64>(d, o)
|
||||
{
|
||||
}
|
||||
|
|
|
|||
|
|
@ -899,7 +899,7 @@ static QBrush brushFromData(const BrushData& c, const QPalette &pal)
|
|||
}
|
||||
}
|
||||
|
||||
static BorderStyle parseStyleValue(QCss::Value v)
|
||||
static BorderStyle parseStyleValue(const QCss::Value &v)
|
||||
{
|
||||
if (v.type == Value::KnownIdentifier) {
|
||||
switch (v.variant.toInt()) {
|
||||
|
|
|
|||
|
|
@ -3141,7 +3141,7 @@ void QTextHtmlExporter::emitTable(const QTextTable *table)
|
|||
html += QLatin1String("</table>");
|
||||
}
|
||||
|
||||
void QTextHtmlExporter::emitFrame(QTextFrame::Iterator frameIt)
|
||||
void QTextHtmlExporter::emitFrame(const QTextFrame::Iterator &frameIt)
|
||||
{
|
||||
if (!frameIt.atEnd()) {
|
||||
QTextFrame::Iterator next = frameIt;
|
||||
|
|
|
|||
|
|
@ -378,7 +378,7 @@ private:
|
|||
enum StyleMode { EmitStyleTag, OmitStyleTag };
|
||||
enum FrameType { TextFrame, TableFrame, RootFrame };
|
||||
|
||||
void emitFrame(QTextFrame::Iterator frameIt);
|
||||
void emitFrame(const QTextFrame::Iterator &frameIt);
|
||||
void emitTextFrame(const QTextFrame *frame);
|
||||
void emitBlock(const QTextBlock &block);
|
||||
void emitTable(const QTextTable *table);
|
||||
|
|
|
|||
|
|
@ -295,7 +295,7 @@ static inline bool isEmptyBlockBeforeTable(const QTextBlock &block, const QTextB
|
|||
;
|
||||
}
|
||||
|
||||
static inline bool isEmptyBlockBeforeTable(QTextFrame::Iterator it)
|
||||
static inline bool isEmptyBlockBeforeTable(const QTextFrame::Iterator &it)
|
||||
{
|
||||
QTextFrame::Iterator next = it; ++next;
|
||||
if (it.currentFrame())
|
||||
|
|
@ -419,7 +419,7 @@ static bool operator<(int pos, const QCheckPoint &checkPoint)
|
|||
|
||||
#endif
|
||||
|
||||
static void fillBackground(QPainter *p, const QRectF &rect, QBrush brush, const QPointF &origin, QRectF gradientRect = QRectF())
|
||||
static void fillBackground(QPainter *p, const QRectF &rect, QBrush brush, const QPointF &origin, const QRectF &gradientRect = QRectF())
|
||||
{
|
||||
p->save();
|
||||
if (brush.style() >= Qt::LinearGradientPattern && brush.style() <= Qt::ConicalGradientPattern) {
|
||||
|
|
@ -1504,7 +1504,7 @@ void QTextDocumentLayoutPrivate::drawListItem(const QPointF &offset, QPainter *p
|
|||
painter->restore();
|
||||
}
|
||||
|
||||
static QFixed flowPosition(const QTextFrame::iterator it)
|
||||
static QFixed flowPosition(const QTextFrame::iterator &it)
|
||||
{
|
||||
if (it.atEnd())
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -843,7 +843,7 @@ enum JustificationClass {
|
|||
Adds an inter character justification opportunity after the number or letter
|
||||
character and a space justification opportunity after the space character.
|
||||
*/
|
||||
static inline void qt_getDefaultJustificationOpportunities(const ushort *string, int length, QGlyphLayout g, ushort *log_clusters, int spaceAs)
|
||||
static inline void qt_getDefaultJustificationOpportunities(const ushort *string, int length, const QGlyphLayout &g, ushort *log_clusters, int spaceAs)
|
||||
{
|
||||
int str_pos = 0;
|
||||
while (str_pos < length) {
|
||||
|
|
@ -877,7 +877,7 @@ static inline void qt_getDefaultJustificationOpportunities(const ushort *string,
|
|||
}
|
||||
}
|
||||
|
||||
static inline void qt_getJustificationOpportunities(const ushort *string, int length, const QScriptItem &si, QGlyphLayout g, ushort *log_clusters)
|
||||
static inline void qt_getJustificationOpportunities(const ushort *string, int length, const QScriptItem &si, const QGlyphLayout &g, ushort *log_clusters)
|
||||
{
|
||||
Q_ASSERT(length > 0 && g.numGlyphs > 0);
|
||||
|
||||
|
|
@ -3509,7 +3509,7 @@ QTextItemInt QTextItemInt::midItem(QFontEngine *fontEngine, int firstGlyphIndex,
|
|||
}
|
||||
|
||||
|
||||
QTransform qt_true_matrix(qreal w, qreal h, QTransform x)
|
||||
QTransform qt_true_matrix(qreal w, qreal h, const QTransform &x)
|
||||
{
|
||||
QRectF rect = x.mapRect(QRectF(0, 0, w, h));
|
||||
return x * QTransform::fromTranslate(-rect.x(), -rect.y());
|
||||
|
|
|
|||
|
|
@ -975,7 +975,7 @@ void QTextLayout::setFlags(int flags)
|
|||
}
|
||||
|
||||
static void addSelectedRegionsToPath(QTextEngine *eng, int lineNumber, const QPointF &pos, QTextLayout::FormatRange *selection,
|
||||
QPainterPath *region, QRectF boundingRect)
|
||||
QPainterPath *region, const QRectF &boundingRect)
|
||||
{
|
||||
const QScriptLine &line = eng->lines[lineNumber];
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue