Summary: | [Qt] Consider prefering QImage* over QPixmap* as NativeImagePtr | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Holger Freyther <zecke> | ||||
Component: | WebCore Misc. | Assignee: | Nobody <webkit-unassigned> | ||||
Status: | RESOLVED INVALID | ||||||
Severity: | Enhancement | CC: | hausmann, jturcotte, tonikitoo | ||||
Priority: | P2 | Keywords: | Qt, QtTriaged | ||||
Version: | 528+ (Nightly build) | ||||||
Hardware: | PC | ||||||
OS: | OS X 10.5 | ||||||
Attachments: |
|
Description
Holger Freyther
2009-10-08 07:43:22 PDT
Created attachment 40870 [details]
Proposed change to change NativeImagePtr to QImage and method to cache certain images as QPixmap
If measurements show that this patch is faster I would heavily encourage to use it. For now I'm seeking for review, advice and ideas on how to fill the findScaledOrCreatePixmap with content. I'm searching for criteria where we would like to create a QPixmap for performance reasons and assume we have access to CachedImage as well.
Hmm, is the goal to distinguish between a paintengine that _can_ draw transformed pixmaps efficiently (i.e. openvg or opengl) and a paintengine that fails to do so (x11) ? If yes, I guess we could try to use the paint engine's feature flags to determine this at run-time. (In reply to comment #2) > Hmm, is the goal to distinguish between a paintengine that _can_ draw > transformed pixmaps efficiently (i.e. openvg or opengl) and a paintengine that > fails to do so (x11) ? > > If yes, I guess we could try to use the paint engine's feature flags to > determine this at run-time. This would be one idea, in general this is about collecting ideas and then measuring. My impression is that blindly converting to a QPixmap even if it is only painted once will not be a win so we should have a better strategy. Some more background information. When looking at the Szeged Image test site we load big images and scale them down to 100x100. So what happens there is we load the big QImage, convert it to a bigger QPixmap (XImage..) and upload, convert it back to a bigger QImage, paint. After having instrumented the BitmapImage::drawImage routine on the test content I see that the above is the minority. From my instrumentation something like 10% of draw operations are scaling images. Comment on attachment 40870 [details]
Proposed change to change NativeImagePtr to QImage and method to cache certain images as QPixmap
I'm not an expert on this code, but in general terms, this patch seems fine. However, the patch itself either has tabs or incorrect indenting.
=== Bulk closing of Qt bugs === If you believe that this bug report is still relevant for a non-Qt port of webkit.org, please re-open it and remove [Qt] from the summary. If you believe that this is still an important QtWebKit bug, please fill a new report at https://bugreports.qt-project.org and add a link to this issue. See http://qt-project.org/wiki/ReportingBugsInQt for additional guidelines. |