summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qharfbuzzng.cpp
diff options
context:
space:
mode:
authorKonstantin Ritt <ritt.ks@gmail.com>2014-01-30 05:46:35 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-01-30 12:43:33 +0100
commita5614264d5a5d6d1cc0f2773f4d7cd70195a0546 (patch)
tree23ce986e78fd6d84e57972be6502fa9ac7f2d7dc /src/gui/text/qharfbuzzng.cpp
parentdca65cd2bc1a999b81df9d45c317a92651db3f82 (diff)
Get rid of QGlyphLayout::advances_y
...and thus consume 4 bytes less per glyph and increase the performance a bit. It seems, the only CTFontGetAdvancesForGlyphs() returns both x and y advances, though y advances are always equal to 0 for horizontal orientation and x advances are always equal to 0 for vertical orientation. Also, rename `advances_x` to `advances` for consistency and declare QGlyphLayout's data size in a single place. Change-Id: I56b20f893f8a6feb7aa870e3edbca99dd93ba2e2 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/gui/text/qharfbuzzng.cpp')
-rw-r--r--src/gui/text/qharfbuzzng.cpp16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/gui/text/qharfbuzzng.cpp b/src/gui/text/qharfbuzzng.cpp
index b4ab5856df..c5bedecbfe 100644
--- a/src/gui/text/qharfbuzzng.cpp
+++ b/src/gui/text/qharfbuzzng.cpp
@@ -439,18 +439,16 @@ _hb_qt_font_get_glyph_h_advance(hb_font_t *font, void *font_data,
QFontEngine *fe = (QFontEngine *)font_data;
Q_ASSERT(fe);
- QFixed advance_x;
- QFixed advance_y;
+ QFixed advance;
QGlyphLayout g;
g.numGlyphs = 1;
g.glyphs = &glyph;
- g.advances_x = &advance_x;
- g.advances_y = &advance_y;
+ g.advances = &advance;
fe->recalcAdvances(&g, QFontEngine::ShaperFlags(hb_qt_font_get_use_design_metrics(font)));
- return g.advances_x[0].value();
+ return g.advances[0].value();
}
static hb_position_t
@@ -490,18 +488,16 @@ _hb_qt_font_get_glyph_h_kerning(hb_font_t *font, void *font_data,
Q_ASSERT(fe);
glyph_t glyphs[2] = { first_glyph, second_glyph };
- QFixed advance_x;
- QFixed advance_y;
+ QFixed advance;
QGlyphLayout g;
g.numGlyphs = 2;
g.glyphs = glyphs;
- g.advances_x = &advance_x;
- g.advances_y = &advance_y;
+ g.advances = &advance;
fe->doKerning(&g, QFontEngine::ShaperFlags(hb_qt_font_get_use_design_metrics(font)));
- return g.advances_x[0].value();
+ return g.advances[0].value();
}
static hb_position_t