Bug 49718 - [Qt] Canvas doesn't animate on OpenVG backend
Summary: [Qt] Canvas doesn't animate on OpenVG backend
Alias: None
Product: WebKit
Classification: Unclassified
Component: Canvas (show other bugs)
Version: 528+ (Nightly build)
Hardware: S60 Hardware S60 3rd edition
: P1 Critical
Assignee: Andreas Kling
Keywords: Qt, QtTriaged
Depends on:
Reported: 2010-11-18 00:42 PST by Janne Koskinen
Modified: 2011-05-10 13:45 PDT (History)
8 users (show)

See Also:

simple testcase (1.73 KB, text/html)
2010-11-18 00:42 PST, Janne Koskinen
no flags Details
patch for QtWebkit2.1 branch (1.80 KB, patch)
2010-11-18 00:49 PST, Janne Koskinen
no flags Details | Formatted Diff | Diff
Proposed patch (2.63 KB, patch)
2011-04-08 10:33 PDT, Andreas Kling
hausmann: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Janne Koskinen 2010-11-18 00:42:32 PST
Created attachment 74211 [details]
simple testcase

Qt targets using OpenVG or other lazy graphics backend don't receive updates on canvas thus no animation based on setInterval or setTimeout works.
Simple testcase demonstrates this issue with drawing 2 lines. Second line drawn after 2 seconds never appears on N8 unless backingstore is destroyed (screensaver,app swap).

This is regression introduced by http://trac.webkit.org/changeset/63606

I set severity to critical as all released Symbian^3 devices use OpenVG.
Comment 1 Janne Koskinen 2010-11-18 00:49:12 PST
Created attachment 74213 [details]
patch for QtWebkit2.1 branch

Adding my fix suggestion to QtWebkit2.1 branch. Trunk will need a the patch to be modified and I'm hoping that someone would come up with better solution.
Whole issue is that VGImage of canvas in Graphics memory won't get updated when pixmap is drawn to. Issue comes from QPainter context that we use here doesn't get end() and state is not flushed. VGImage to be created a flag recreate needs to be set. Simplest way (and cheapest) is to call paintEngine() i.e. what the patch does.
Comment 2 Janne Koskinen 2010-11-18 01:00:45 PST
Originating bug is QT-4002.
Comment 3 Laszlo Gombos 2010-11-18 05:13:18 PST
Andreas, what do you think ?
Comment 4 Andreas Kling 2010-11-18 05:24:53 PST
(In reply to comment #3)
> Andreas, what do you think ?

I'm fine with putting this hack on the 2.1 branch. The OpenVG paint engine should ultimately be fixed in Qt though.
Comment 5 Ademar Reis 2010-11-18 11:07:13 PST
The initial patch/hack was pushed to QtWebKit-2.1: http://gitorious.org/webkit/qtwebkit/commit/fcda7935a66d4fec886503fa666cb37379247cb5
Comment 6 Suresh Voruganti 2011-01-06 10:56:11 PST
Ademar, bug is in open state, even though fix cherry picked to Qtwebkit 2.1, can you resolve the issue?
Comment 7 Ademar Reis 2011-01-06 11:12:03 PST
(In reply to comment #6)
> Ademar, bug is in open state, even though fix cherry picked to Qtwebkit 2.1, can you resolve the issue?

Yes. It was agreed that a hack/workaround would be pushed to 2.1, but the real fix on trunk is pending, see comment #4 and comment #5.

It should be blocking bug 32653 (patches pending trunk inclusion) though, fixed.
Comment 8 Andreas Kling 2011-04-08 10:33:14 PDT
Created attachment 88838 [details]
Proposed patch

Proposal for trunk, use ImageBuffer's drawsUsingCopy() mechanism for OpenVG-backed pixmaps.
Comment 9 Simon Hausmann 2011-04-26 16:11:32 PDT
Comment on attachment 88838 [details]
Proposed patch

Ugly, but no choice :)
Comment 10 Jason Barron 2011-04-27 07:09:43 PDT
Sorry for the delay, but we have a fix for this in Qt's OpenVG graphics system now using something similar to the OpenGL fix Andreas made:


Submitted to Qt 4.7.4. It will forcefully upload the canvas to a VGImage as long as there is still a painter open on it.
Comment 11 Andreas Kling 2011-04-29 15:57:11 PDT
Closing as this is fixed in Qt 4.7.4 per Jason's comment.