summaryrefslogtreecommitdiffstats
path: root/examples/openvg/star
diff options
context:
space:
mode:
authorRhys Weatherley <rhys.weatherley@nokia.com>2010-03-05 02:39:17 (GMT)
committerRhys Weatherley <rhys.weatherley@nokia.com>2010-03-05 02:39:17 (GMT)
commit57c847ed2c0b4116ea791828c41db5edc40fe2f2 (patch)
treef34b81c02bb720783591c60c9860d745b4ed1019 /examples/openvg/star
parentd0564dfd69c3288c62009e57b666f33928a70a4b (diff)
downloadQt-57c847ed2c0b4116ea791828c41db5edc40fe2f2.zip
Qt-57c847ed2c0b4116ea791828c41db5edc40fe2f2.tar.gz
Qt-57c847ed2c0b4116ea791828c41db5edc40fe2f2.tar.bz2
Make the star example recreate its path if the VG context is destroyed.
Task-number: QT-2809 Reviewed-by: trustme
Diffstat (limited to 'examples/openvg/star')
-rw-r--r--examples/openvg/star/starwidget.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/examples/openvg/star/starwidget.cpp b/examples/openvg/star/starwidget.cpp
index bde0719..794ede9 100644
--- a/examples/openvg/star/starwidget.cpp
+++ b/examples/openvg/star/starwidget.cpp
@@ -93,8 +93,9 @@ void StarWidget::paintEvent(QPaintEvent *)
// and prepare to perform raw OpenVG calls.
painter.beginNativePainting();
- // Cache the path if we haven't already.
- if (path == VG_INVALID_HANDLE) {
+ // Cache the path if we haven't already or if the path has
+ // become invalid because the window's context has changed.
+ if (path == VG_INVALID_HANDLE || !vgGetPathCapabilities(path)) {
path = vgCreatePath(VG_PATH_FORMAT_STANDARD,
VG_PATH_DATATYPE_F,
1.0f, // scale