summaryrefslogtreecommitdiffstats
path: root/src/openvg
diff options
context:
space:
mode:
authorRhys Weatherley <rhys.weatherley@nokia.com>2009-10-27 06:38:24 (GMT)
committerRhys Weatherley <rhys.weatherley@nokia.com>2009-10-27 06:38:24 (GMT)
commit5a4909d9f87b9abf471908a085c0e9f31b7e0a50 (patch)
tree66aee777bf2aba29c8775a560ebe0619539bb7a9 /src/openvg
parentf06d7a128bf6b231fde521f7008db48138783731 (diff)
downloadQt-5a4909d9f87b9abf471908a085c0e9f31b7e0a50.zip
Qt-5a4909d9f87b9abf471908a085c0e9f31b7e0a50.tar.gz
Qt-5a4909d9f87b9abf471908a085c0e9f31b7e0a50.tar.bz2
Fix OpenVG window composition when opacity != 1
Task-number: QT-2322 Reviewed-by: Sarah Smith
Diffstat (limited to 'src/openvg')
-rw-r--r--src/openvg/qpaintengine_vg.cpp36
1 files changed, 16 insertions, 20 deletions
diff --git a/src/openvg/qpaintengine_vg.cpp b/src/openvg/qpaintengine_vg.cpp
index f8dd8a5..94e0793 100644
--- a/src/openvg/qpaintengine_vg.cpp
+++ b/src/openvg/qpaintengine_vg.cpp
@@ -3455,28 +3455,24 @@ void QVGCompositionHelper::blitWindow
// Set the image transform.
QTransform transform;
int y = screenSize.height() - (rect.bottom() + 1);
- transform.translate(rect.x() + 0.5f, y + 0.5f);
+ transform.translate(rect.x() - 0.5f, y - 0.5f);
d->setTransform(VG_MATRIX_IMAGE_USER_TO_SURFACE, transform);
// Enable opacity for image drawing if necessary.
- if (opacity < 255) {
- if (opacity != d->paintOpacity) {
- VGfloat values[4];
- values[0] = 1.0f;
- values[1] = 1.0f;
- values[2] = 1.0f;
- values[3] = ((VGfloat)opacity) / 255.0f;
- vgSetParameterfv(d->opacityPaint, VG_PAINT_COLOR, 4, values);
- d->paintOpacity = values[3];
- }
- if (d->fillPaint != d->opacityPaint) {
- vgSetPaint(d->opacityPaint, VG_FILL_PATH);
- d->fillPaint = d->opacityPaint;
- }
- d->setImageMode(VG_DRAW_IMAGE_MULTIPLY);
- } else {
- d->setImageMode(VG_DRAW_IMAGE_NORMAL);
+ if (opacity != d->paintOpacity) {
+ VGfloat values[4];
+ values[0] = 1.0f;
+ values[1] = 1.0f;
+ values[2] = 1.0f;
+ values[3] = ((VGfloat)opacity) / 255.0f;
+ vgSetParameterfv(d->opacityPaint, VG_PAINT_COLOR, 4, values);
+ d->paintOpacity = values[3];
+ }
+ if (d->fillPaint != d->opacityPaint) {
+ vgSetPaint(d->opacityPaint, VG_FILL_PATH);
+ d->fillPaint = d->opacityPaint;
}
+ d->setImageMode(VG_DRAW_IMAGE_MULTIPLY);
// Draw the child image.
vgDrawImage(child);
@@ -3558,7 +3554,7 @@ void QVGCompositionHelper::fillBackground
VGfloat devh = screenSize.height() - 1;
QTransform viewport(1.0f, 0.0f, 0.0f,
0.0f, -1.0f, 0.0f,
- 0.5f, devh + 0.5f, 1.0f);
+ -0.5f, devh + 0.5f, 1.0f);
d->setTransform(VG_MATRIX_PATH_USER_TO_SURFACE, viewport);
// Set the brush to use to fill the background.
@@ -3612,7 +3608,7 @@ void QVGCompositionHelper::drawCursorPixmap
VGfloat devh = screenSize.height() - 1;
QTransform transform(1.0f, 0.0f, 0.0f,
0.0f, -1.0f, 0.0f,
- 0.5f, devh + 0.5f, 1.0f);
+ -0.5f, devh + 0.5f, 1.0f);
transform.translate(offset.x(), offset.y());
d->setTransform(VG_MATRIX_IMAGE_USER_TO_SURFACE, transform);