From a69b2c01684756c959de7645451f02397ca19b51 Mon Sep 17 00:00:00 2001 From: Konstantin Ritt Date: Sat, 22 Nov 2014 06:03:52 +0400 Subject: [QStaticTextItem] Drop unused members The QStaticTextItem's `chars` and `numChars` members are never used, even when set. In fact, there is nothing useful we can do with the input string in the absence of clusters mapping. Change-Id: I81fcbce3e575f4d0dcfc2515286d512b858f592b Reviewed-by: Lars Knoll --- src/gui/text/qstatictext_p.h | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) (limited to 'src/gui/text/qstatictext_p.h') diff --git a/src/gui/text/qstatictext_p.h b/src/gui/text/qstatictext_p.h index 29db8836d9..694a2e4baa 100644 --- a/src/gui/text/qstatictext_p.h +++ b/src/gui/text/qstatictext_p.h @@ -70,7 +70,7 @@ public: class Q_GUI_EXPORT QStaticTextItem { public: - QStaticTextItem() : chars(0), numChars(0), useBackendOptimizations(false), + QStaticTextItem() : useBackendOptimizations(false), userDataNeedsUpdate(0), usesRawFont(0), m_fontEngine(0), m_userData(0) {} @@ -83,9 +83,7 @@ public: { glyphPositions = other.glyphPositions; glyphs = other.glyphs; - chars = other.chars; numGlyphs = other.numGlyphs; - numChars = other.numChars; font = other.font; color = other.color; useBackendOptimizations = other.useBackendOptimizations; @@ -124,29 +122,23 @@ public: union { glyph_t *glyphs; // 4 bytes per glyph int glyphOffset; - }; - union { - QChar *chars; // 2 bytes per glyph - int charOffset; }; // ================= - // 14 bytes per glyph + // 12 bytes per glyph - // 12 bytes for pointers + // 8 bytes for pointers int numGlyphs; // 4 bytes per item - int numChars; // 4 bytes per item QFont font; // 8 bytes per item QColor color; // 10 bytes per item char useBackendOptimizations : 1; // 1 byte per item char userDataNeedsUpdate : 1; // char usesRawFont : 1; // - // ================ - // 51 bytes per item private: // Needs special handling in setters, so private to avoid abuse QFontEngine *m_fontEngine; // 4 bytes per item QStaticTextUserData *m_userData; // 8 bytes per item - + // ================ + // 43 bytes per item }; class QStaticText; @@ -179,7 +171,6 @@ public: glyph_t *glyphPool; // 4 bytes per text QFixedPoint *positionPool; // 4 bytes per text - QChar *charPool; // 4 bytes per text QTextOption textOption; // 28 bytes per text @@ -188,7 +179,7 @@ public: unsigned char textFormat : 2; unsigned char untransformedCoordinates : 1; // ================ - // 195 bytes per text + // 191 bytes per text static QStaticTextPrivate *get(const QStaticText *q); }; -- cgit v1.2.3