Bug 49377 - [Qt][WK2] Implement BackingStore
Summary: [Qt][WK2] Implement BackingStore
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC All
: P2 Normal
Assignee: Nobody
Depends on:
Reported: 2010-11-11 04:56 PST by Balazs Kelemen
Modified: 2010-11-11 09:22 PST (History)
2 users (show)

See Also:

Patch (5.78 KB, patch)
2010-11-11 05:31 PST, Balazs Kelemen
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Balazs Kelemen 2010-11-11 04:56:24 PST
Fill stubbed BackingStore with implmentation!
Comment 1 Balazs Kelemen 2010-11-11 05:10:25 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.
Comment 2 Balazs Kelemen 2010-11-11 05:31:22 PST
Created attachment 73601 [details]
Comment 3 Andreas Kling 2010-11-11 07:35:38 PST
Comment on attachment 73601 [details]

Comment 4 Balazs Kelemen 2010-11-11 07:47:52 PST
Comment on attachment 73601 [details]

Clearing flags on attachment: 73601

Committed r71821: <http://trac.webkit.org/changeset/71821>
Comment 5 Balazs Kelemen 2010-11-11 07:48:01 PST
All reviewed patches have been landed.  Closing bug.
Comment 6 Balazs Kelemen 2010-11-11 08:30:10 PST
Noam, could you take a post review on the patch? Maybe it should be tweaked for
performance (maybe the QImage format).
Comment 7 Noam Rosenthal 2010-11-11 08:59:35 PST
Post review looks good!
Comment 8 Andreas Kling 2010-11-11 09:22:40 PST
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.