summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@nokia.com>2010-04-26 09:36:29 (GMT)
committerThiago Macieira <thiago.macieira@nokia.com>2010-04-26 09:36:47 (GMT)
commit274898cf030ae2077d133997906f5ac89ffe716b (patch)
tree3b1690aca94ab4b52dbd639ce30ce19b7304f52d
parent2a1fe68f34c959d6f61aa9944cdf31a2be79c82c (diff)
downloadQt-274898cf030ae2077d133997906f5ac89ffe716b.zip
Qt-274898cf030ae2077d133997906f5ac89ffe716b.tar.gz
Qt-274898cf030ae2077d133997906f5ac89ffe716b.tar.bz2
Attempt again at fixing the OpenVG paint engine build
-rw-r--r--src/openvg/qpaintengine_vg.cpp16
-rw-r--r--src/openvg/qpaintengine_vg_p.h3
2 files changed, 11 insertions, 8 deletions
diff --git a/src/openvg/qpaintengine_vg.cpp b/src/openvg/qpaintengine_vg.cpp
index b332ba4..312408e 100644
--- a/src/openvg/qpaintengine_vg.cpp
+++ b/src/openvg/qpaintengine_vg.cpp
@@ -3279,7 +3279,7 @@ void QVGPaintEngine::drawTextItem(const QPointF &p, const QTextItem &textItem)
QTransform matrix;
ti.fontEngine->getGlyphPositions(ti.glyphs, matrix, ti.flags, glyphs, positions);
- if (!drawCachedGlyphs(glyphs.size(), glyphs.data(), ti.font(), ti.fontEngine, p))
+ if (!drawCachedGlyphs(glyphs.size(), glyphs.data(), ti.font(), ti.fontEngine, positions.data(), p))
QPaintEngineEx::drawTextItem(p, textItem);
#else
// OpenGL 1.0 does not have support for VGFont and glyphs,
@@ -3291,11 +3291,12 @@ void QVGPaintEngine::drawTextItem(const QPointF &p, const QTextItem &textItem)
void QVGPaintEngine::drawStaticTextItem(QStaticTextItem *textItem)
{
drawCachedGlyphs(textItem->numGlyphs, textItem->glyphs, textItem->font, textItem->fontEngine,
- QPointF(0, 0));
+ textItem->positions, QPointF(0, 0));
}
bool QVGPaintEngine::drawCachedGlyphs(int numGlyphs, const glyph_t *glyphs, const QFont &font,
- QFontEngine *fontEngine, const QPointF &p)
+ QFontEngine *fontEngine, const QFixedPoint *positions,
+ const QPointF &p)
{
#if !defined(QVG_NO_DRAW_GLYPHS)
Q_D(QVGPaintEngine);
@@ -3332,9 +3333,9 @@ void QVGPaintEngine::drawStaticTextItem(QStaticTextItem *textItem)
glyphCache->cacheGlyphs(d, fontEngine, glyphs, numGlyphs);
// Create the array of adjustments between glyphs
- QVarLengthArray<VGfloat> adjustments_x(glyphs.size());
- QVarLengthArray<VGfloat> adjustments_y(glyphs.size());
- for (int i = 1; i < glyphs.size(); ++i) {
+ QVarLengthArray<VGfloat> adjustments_x(numGlyphs);
+ QVarLengthArray<VGfloat> adjustments_y(numGlyphs);
+ for (int i = 1; i < numGlyphs; ++i) {
adjustments_x[i-1] = (positions[i].x - positions[i-1].x).toReal();
adjustments_y[i-1] = (positions[i].y - positions[i-1].y).toReal();
}
@@ -3356,7 +3357,7 @@ void QVGPaintEngine::drawStaticTextItem(QStaticTextItem *textItem)
// Draw the glyphs. We need to fill with the brush associated with
// the Qt pen, not the Qt brush.
d->ensureBrush(state()->pen.brush());
- vgDrawGlyphs(glyphCache->font, numGlyphs, (VGuint*)glyphs.data(),
+ vgDrawGlyphs(glyphCache->font, numGlyphs, (VGuint*)glyphs,
adjustments_x.data(), adjustments_y.data(), VG_FILL_PATH, VG_TRUE);
return true;
#else
@@ -3364,6 +3365,7 @@ void QVGPaintEngine::drawStaticTextItem(QStaticTextItem *textItem)
Q_UNUSED(glyphs);
Q_UNUSED(font);
Q_UNUSED(fontEngine);
+ Q_UNUSED(positions);
Q_UNUSED(p);
return false;
#endif
diff --git a/src/openvg/qpaintengine_vg_p.h b/src/openvg/qpaintengine_vg_p.h
index 1e7e26c..24de07c 100644
--- a/src/openvg/qpaintengine_vg_p.h
+++ b/src/openvg/qpaintengine_vg_p.h
@@ -58,6 +58,7 @@
QT_BEGIN_NAMESPACE
+class QFixedPoint;
class QVGPaintEnginePrivate;
class QPixmapData;
class QVGEGLWindowSurfacePrivate;
@@ -143,7 +144,7 @@ public:
void drawTextItem(const QPointF &p, const QTextItem &textItem);
void drawStaticTextItem(QStaticTextItem *staticTextItem);
bool drawCachedGlyphs(int numGlyphs, const glyph_t *glyphs, const QFont &font,
- QFontEngine *fontEngine, const QPointF &p);
+ QFontEngine *fontEngine, const QFixedPoint *positions, const QPointF &p)
void setState(QPainterState *s);
QVGPainterState *state() { return static_cast<QVGPainterState *>(QPaintEngineEx::state()); }