Summary: | [Qt][WK2] Implement BackingStore | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Balazs Kelemen <kbalazs> | ||||
Component: | WebKit2 | Assignee: | Nobody <webkit-unassigned> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | CC: | kling, noam | ||||
Priority: | P2 | ||||||
Version: | 528+ (Nightly build) | ||||||
Hardware: | PC | ||||||
OS: | All | ||||||
Attachments: |
|
Description
Balazs Kelemen
2010-11-11 04:56:24 PST
I have a weird problem with implementing this method: PassOwnPtr<GraphicsContext> BackingStore::createGraphicsContext() I need to create a QImage and a QPainter on heap to create the GraphicsContext. Our GC implementation does not own the painter so this would cause a leak. I took a look at the CoreGraphics and Cairo implementation of GC and those owns the platform specific data. Unfortunately we cannot tweak the GC to behave like those because: 1. in some cases we get the painter from the user so we are not allowed to own that 2. there is no way to create a copy from an active painter (active = begin has been called) So what I did in the change that will be uploaded is adding a way to explicitly take off ownership of the painter and the paint device to the GC. Created attachment 73601 [details]
Patch
Comment on attachment 73601 [details]
Patch
r=me
Comment on attachment 73601 [details] Patch Clearing flags on attachment: 73601 Committed r71821: <http://trac.webkit.org/changeset/71821> All reviewed patches have been landed. Closing bug. Noam, could you take a post review on the patch? Maybe it should be tweaked for performance (maybe the QImage format). Post review looks good! One thing we might want to look at later is letting QImage align its scanlines on 32-bit boundaries (the default behavior) instead of using the cramped W*H*4 format. It basically just means overriding UpdateChunk::size() and removing the stride (width * 4) arguments to QImage constructors. |