diff options
author | Rhys Weatherley <rhys.weatherley@nokia.com> | 2009-11-22 21:00:51 (GMT) |
---|---|---|
committer | Rhys Weatherley <rhys.weatherley@nokia.com> | 2009-11-22 21:00:51 (GMT) |
commit | 50465c3409d699612a59b6c1d16e3502bb3a92fd (patch) | |
tree | 7499c590db41a9accf976274c40243df9ac46377 /src/openvg/qpaintengine_vg.cpp | |
parent | 0b8639aee92913cdfaa4386aa09dde0f5cb2eaee (diff) | |
download | Qt-50465c3409d699612a59b6c1d16e3502bb3a92fd.zip Qt-50465c3409d699612a59b6c1d16e3502bb3a92fd.tar.gz Qt-50465c3409d699612a59b6c1d16e3502bb3a92fd.tar.bz2 |
Support semi-transparent surfaces in the OpenVG graphics system
Task-number: QT-2026
Reviewed-by: Jason Barron
Diffstat (limited to 'src/openvg/qpaintengine_vg.cpp')
-rw-r--r-- | src/openvg/qpaintengine_vg.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/openvg/qpaintengine_vg.cpp b/src/openvg/qpaintengine_vg.cpp index 75b7fa5..fda4b10 100644 --- a/src/openvg/qpaintengine_vg.cpp +++ b/src/openvg/qpaintengine_vg.cpp @@ -3407,6 +3407,34 @@ void QVGPaintEngine::restoreState(QPaintEngine::DirtyFlags dirty) #endif } +void QVGPaintEngine::fillRegion + (const QRegion& region, const QColor& color, const QSize& surfaceSize) +{ + Q_D(QVGPaintEngine); + if (d->clearColor != color || d->clearOpacity != 1.0f) { + VGfloat values[4]; + values[0] = color.redF(); + values[1] = color.greenF(); + values[2] = color.blueF(); + values[3] = color.alphaF(); + vgSetfv(VG_CLEAR_COLOR, 4, values); + d->clearColor = color; + d->clearOpacity = 1.0f; + } + if (region.rectCount() == 1) { + QRect r = region.boundingRect(); + vgClear(r.x(), surfaceSize.height() - r.y() - r.height(), + r.width(), r.height()); + } else { + const QVector<QRect> rects = region.rects(); + for (int i = 0; i < rects.size(); ++i) { + QRect r = rects.at(i); + vgClear(r.x(), surfaceSize.height() - r.y() - r.height(), + r.width(), r.height()); + } + } +} + #if !defined(QVG_NO_SINGLE_CONTEXT) && !defined(QT_NO_EGL) QVGCompositionHelper::QVGCompositionHelper() |