[Webkit-unassigned] [Bug 84987] [Qt] Accelerated 2D canvas

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Jul 12 09:36:57 PDT 2012


https://bugs.webkit.org/show_bug.cgi?id=84987





--- Comment #11 from Jocelyn Turcotte <jocelyn.turcotte at nokia.com>  2012-07-12 09:36:56 PST ---
I worked for a while on an implementation using the QOpenGLPaintEngine in Qt starting from No'am's patch.
It is still pretty unpolished but it works well, I'll have a look at pushing it further if you think it's worth it.

Currently most of the visual issues are related to layouting of the layers and the compositing. To see which issues are related to the paint engine I added a "fake" accelerated mode that use the raster engine and transfers it directly through GraphicsSurface instead of non-composited contents tiles (itself already improve performances a bit).

Issues with QOpenGLPaintEngine that would remain to solve:
1- When mixing non-accelerated (QPixmap based) and accelerated (FBO based) canvases, there is no way to efficiently know if the QPixmap should be re-uploaded in the texture cache. Right now a QPixmap is re-uploaded for every paint if a QPainter is still active on it, which is always the case for the canvas.
I (ab)used the ensureActiveTarget callback in QOpenGLPaintDevice to achieve detecting buffer dirtiness with accelerated-to-accelerated drawImage()s, but there is no such thing with the raster paint engine.
To solve this I think that we would need to remove the paintingActive check in the texture cache and add dirtiness detection in GraphicsContext to know when to trigger a re-upload (possibly by calling QPixmap::detach() and making sure there is only one implicitely shared instance).
One of the commits force to always use accelerated canvases to work around this.

2- There is still work to do to make it fast at least on desktop. Right now my Intel HD 3000 video card produce only slightly better performance than the raster engine with my dual i7 processor. I'd like to know what kind of improvements this would give on a device but I don't currently have access to one implementing GraphicsSurface, so I can't see myself.
I think that there just isn't anybody yet that tried hard to polish the paint engine for speed, I saw a couple of places where simple patches could improve the speed already.

Anyway here it is, the patches for WebKit are there:
https://github.com/jturcotte/webkit/tree/qpainterAcceleratedCanvas
And you also need to cherry-pick this texture tiling implementation in qtbase (that I wouldn't want to push before 5.0 is branched):
https://qt.gitorious.org/~jturcotte/qt/jturcottes-qtbase/commits/textureTiling

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list