diff options
author | Jiang Jiang <jiang.jiang@nokia.com> | 2011-07-25 10:52:48 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-07-25 11:50:16 +0200 |
commit | 8d762c9caea4f8b9ff589b6c23564f4e37242745 (patch) | |
tree | e77836db3e94ab2617eb6dd3d54574fa15d9a3a1 /src/gui/painting/qpaintengineex.cpp | |
parent | a150880ae6ea698a2e979c93498db4f3bb66c1b0 (diff) |
Making cached glyphs drawing check clearer
Putting the logic inside supportsTransformation() is a bit confusing and
that name is misleading.
Also move the same check in GL2 paint engine to the same place.
Change-Id: I182500a0ff375122e6be966b7ce2495c84d113d0
Reviewed-on: http://codereview.qt.nokia.com/2096
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
Diffstat (limited to 'src/gui/painting/qpaintengineex.cpp')
-rw-r--r-- | src/gui/painting/qpaintengineex.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/gui/painting/qpaintengineex.cpp b/src/gui/painting/qpaintengineex.cpp index 9427dd5105..5ef6900cc8 100644 --- a/src/gui/painting/qpaintengineex.cpp +++ b/src/gui/painting/qpaintengineex.cpp @@ -53,6 +53,10 @@ QT_BEGIN_NAMESPACE +#if !defined(QT_MAX_CACHED_GLYPH_SIZE) +# define QT_MAX_CACHED_GLYPH_SIZE 64 +#endif + /******************************************************************************* * * class QVectorPath @@ -1096,4 +1100,10 @@ bool QPaintEngineEx::supportsTransformations(qreal pixelSize, const QTransform & return false; } +bool QPaintEngineEx::shouldDrawCachedGlyphs(qreal pixelSize, const QTransform &m) const +{ + return (pixelSize * pixelSize * qAbs(m.determinant())) < + QT_MAX_CACHED_GLYPH_SIZE * QT_MAX_CACHED_GLYPH_SIZE; +} + QT_END_NAMESPACE |