[Development] Qt 4.8 and possibly 5: QVGPaintEngine implement a cache manager for vgpaths.

gunnar.sletta at nokia.com gunnar.sletta at nokia.com
Fri Feb 24 07:17:00 CET 2012


> I am interested in implementing a cache manager for VGPath(s)  for the
> openvg sybsystem, and I am thinking after a bit of reading the proper
> way to do that,is by creating an LRU (in similar fashion as with
> QVGImagePool).
> 
> Since paths are more prone to alterations (to my understanding at
> least) am looking a way to quickly destroy the vgpath associated, and
> the only viable way is by <ahem>adding some extra logic in the
> QVectorPath and QPainterPath to handle the invalidations (ideally it
> would be just check if a pointer is non-null and then free).

QVectorPath already has this logic built in, so no hacking required. The OpenGL 2 paint engine uses this mechanism to store triangulated polygons. In practice we found that it doesn't help as often as we like because users very rarely store their QPainterPath's between one paintEvent() and the next and creating a cache based on the content of the data-array is too high a price to pay. 

You should also know that there is no longer any QVGPaintEngine in Qt 5.  

cheers,
Gunnar





More information about the Development mailing list