Fix renderType: Text.NativeRendering on retina screens
authorTor Arne Vestbø <tor.arne.vestbo@digia.com>
Wed, 26 Feb 2014 14:27:23 +0000 (15:27 +0100)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Fri, 28 Feb 2014 01:36:18 +0000 (02:36 +0100)
commit3f88a5b835198e39e899bc77d798f48f0fe593bb
tree72f7a88b6fa21ee7d80da599c113e75be3be4d16
parent78cee4eb22ee6b0b61f5d89c98f15e61e7c52078
Fix renderType: Text.NativeRendering on retina screens

The QSGDefaultGlyphNode's QSGTextMaskMaterial failed to take the device
pixel ratio of the surface into account, both when building the glyph
cache in init() and when blitting the glyphs from the cache in populate().

We now handle both, resulting in equal rendering as the raster engine,
which itself matches CoreText, except for some minor shaping differences.

One snag with the QSGTextMaskMaterial compared to eg. the raster engine
is that the incoming glyph positions (from shaping) are not pre-scaled,
which means we have to be careful to apply the device pixel ratio before
rounding the coordinates, to match the behavior of the raster engine.

Change-Id: I51cf796bd437f68fad298f689ee3f2d9a2863b4d
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
src/quick/scenegraph/qsgdefaultglyphnode_p.cpp