diff options
author | Jason Barron <jbarron@trolltech.com> | 2010-02-19 11:05:44 (GMT) |
---|---|---|
committer | Jason Barron <jbarron@trolltech.com> | 2010-02-22 08:35:24 (GMT) |
commit | 1eb303d4f14dfcffcca3f11cacca7a73f1e53342 (patch) | |
tree | 287405bcb6d29d40691aa9a1124e49394f97b37a /src/openvg/qpaintengine_vg.cpp | |
parent | 1a8fffa8cae5b4094adcd87bfc4cbc24599d7305 (diff) | |
download | Qt-1eb303d4f14dfcffcca3f11cacca7a73f1e53342.zip Qt-1eb303d4f14dfcffcca3f11cacca7a73f1e53342.tar.gz Qt-1eb303d4f14dfcffcca3f11cacca7a73f1e53342.tar.bz2 |
Don't use vgClear() for semi-transparent brushes.
If the brush is not totally opaque we should not use vgClear() at this
point because vgClear() does not support blending. Instead it writes
the values directly into the surface which clobbers any existing
content. The bug exhibits itself when a child widget fills itself with
any transparent color. Instead of blending with the parent widget's
content, it writes the semi-transparent color directly to the surface,
overwriting the parent content and leaving the surface in a somewhat
undefined state because the alpha channel is not honoured unless
Qt::WA_TranslucentBackground is set.
Task-number: QTBUG-8007
Reviewed-by: Rhys Weatherley
Diffstat (limited to 'src/openvg/qpaintengine_vg.cpp')
-rw-r--r-- | src/openvg/qpaintengine_vg.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/openvg/qpaintengine_vg.cpp b/src/openvg/qpaintengine_vg.cpp index 6813d2f..da47f06 100644 --- a/src/openvg/qpaintengine_vg.cpp +++ b/src/openvg/qpaintengine_vg.cpp @@ -2399,7 +2399,7 @@ void QVGPaintEngine::fillRect(const QRectF &rect, const QBrush &brush) return; // Check to see if we can use vgClear() for faster filling. - if (brush.style() == Qt::SolidPattern && + if (brush.style() == Qt::SolidPattern && brush.isOpaque() && clipTransformIsSimple(d->transform) && d->opacity == 1.0f && clearRect(rect, brush.color())) { return; @@ -2442,7 +2442,7 @@ void QVGPaintEngine::fillRect(const QRectF &rect, const QColor &color) Q_D(QVGPaintEngine); // Check to see if we can use vgClear() for faster filling. - if (clipTransformIsSimple(d->transform) && d->opacity == 1.0f && + if (clipTransformIsSimple(d->transform) && d->opacity == 1.0f && color.alpha() == 255 && clearRect(rect, color)) { return; } |