summaryrefslogtreecommitdiffstats
path: root/src/openvg/qvgfontglyphcache_p.h
diff options
context:
space:
mode:
authorJason Barron <jbarron@trolltech.com>2010-02-26 12:47:45 (GMT)
committerJason Barron <jbarron@trolltech.com>2010-07-12 07:03:09 (GMT)
commit8c6bfd9f2d34822e39812c07e821fa17ab3fdcb2 (patch)
tree6aa897a6c31bf8eb9611b039fc83f2b48a8a627e /src/openvg/qvgfontglyphcache_p.h
parent940930dd8102511e6890ed661cf3d2dd88c2e1f4 (diff)
downloadQt-8c6bfd9f2d34822e39812c07e821fa17ab3fdcb2.zip
Qt-8c6bfd9f2d34822e39812c07e821fa17ab3fdcb2.tar.gz
Qt-8c6bfd9f2d34822e39812c07e821fa17ab3fdcb2.tar.bz2
Ensure glyphs are upright instead of upside-down.
The OpenVG paint engine traditionally takes glyph images from the alphaMapForGlyph() function which returns the glyph image in the upright projection. When it constructs a VGImage from this image, it passes a positive data stride which will read the top scanline of the source image into the bottom scanline of the VGImage due to the VG coordinate system. It then uses the path transform where the 'sy' value of the matrix is set to -1 and this re-inverts everything when drawing. With the Symbian based glyph cache, the VGImage is constructed from a RSgImage which is a hardware resource and compensates for the coordinate system used by VG and GL at the time it is created. In the case of the hardware glyph cache, the glyph image is read into the RSgImage using a negative data stride so it does not need to be inverted when drawn. To allow for this, introduce a flag which indicates that the 'sy' entry of the matrix should be flipped such that the glyph is drawn normally. Also in this patch is a change to the glyph origin which now uses the bottom of the glyph metric bounding rect instead of the top due to orientation of the glyph inside the VGImage. Reviewed-by: Alessandro Portale
Diffstat (limited to 'src/openvg/qvgfontglyphcache_p.h')
-rw-r--r--src/openvg/qvgfontglyphcache_p.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/openvg/qvgfontglyphcache_p.h b/src/openvg/qvgfontglyphcache_p.h
index ee11082..8f25322 100644
--- a/src/openvg/qvgfontglyphcache_p.h
+++ b/src/openvg/qvgfontglyphcache_p.h
@@ -74,6 +74,7 @@ public:
VGFont font;
VGfloat scaleX;
VGfloat scaleY;
+ bool invertedGlyphs;
uint cachedGlyphsMask[256 / 32];
QSet<glyph_t> cachedGlyphs;
@@ -82,6 +83,8 @@ public:
#if defined(Q_OS_SYMBIAN)
class QSymbianVGFontGlyphCache : public QVGFontGlyphCache
{
+public:
+ QSymbianVGFontGlyphCache();
void cacheGlyphs(QVGPaintEnginePrivate *d,
const QTextItemInt &ti,
const QVarLengthArray<glyph_t> &glyphs);