Summary: | WebKit2 View Gestures (Swipe): Add a simple cache of view snapshots | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Tim Horton <thorton> | ||||||||
Component: | WebKit2 | Assignee: | Tim Horton <thorton> | ||||||||
Status: | RESOLVED FIXED | ||||||||||
Severity: | Normal | CC: | andersca, sam, simon.fraser | ||||||||
Priority: | P2 | ||||||||||
Version: | 528+ (Nightly build) | ||||||||||
Hardware: | Unspecified | ||||||||||
OS: | Unspecified | ||||||||||
Bug Depends on: | |||||||||||
Bug Blocks: | 127363 | ||||||||||
Attachments: |
|
Description
Tim Horton
2014-01-22 11:49:58 PST
Created attachment 221887 [details]
patch
Errm, I need a way to make us not take snapshots if swiping isn't enabled. Created attachment 221897 [details]
patch disabled by default
Comment on attachment 221897 [details] patch disabled by default View in context: https://bugs.webkit.org/attachment.cgi?id=221897&action=review > Source/WebKit2/UIProcess/mac/ViewSnapshotStore.h:48 > + CGImageRef getSnapshotAndRenderTreeSize(WebBackForwardListItem*, uint64_t& renderTreeSize); This should return a std::pair<RetainPtr<CGImageRef>, uint64_t> > Source/WebKit2/UIProcess/mac/ViewSnapshotStore.mm:76 > + WKView *wkView = webPageProxy.wkView(); This class should not know about WKView! Instead, takeSnapshot() should really do all its work through the PageClient interface. Is there a WebCore image type we could use for this kind of thing instead of CGImageRef directly? (In reply to comment #4) > (From update of attachment 221897 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=221897&action=review > > > Source/WebKit2/UIProcess/mac/ViewSnapshotStore.h:48 > > + CGImageRef getSnapshotAndRenderTreeSize(WebBackForwardListItem*, uint64_t& renderTreeSize); > > This should return a std::pair<RetainPtr<CGImageRef>, uint64_t> So much better. > > Source/WebKit2/UIProcess/mac/ViewSnapshotStore.mm:76 > > + WKView *wkView = webPageProxy.wkView(); > > This class should not know about WKView! Instead, takeSnapshot() should really do all its work through the PageClient interface. OK. > Is there a WebCore image type we could use for this kind of thing instead of CGImageRef directly? I didn't want to get too locked into something like that until we figure out the purgeability story. > > Is there a WebCore image type we could use for this kind of thing instead of CGImageRef directly?
>
> I didn't want to get too locked into something like that until we figure out the purgeability story.
Ok.
(In reply to comment #5) > > > > This class should not know about WKView! Instead, takeSnapshot() should really do all its work through the PageClient interface. > For classes that are Mac only I see no problem exposing the view directly. Maybe this is not a Mac only class though. (In reply to comment #7) > (In reply to comment #5) > > > > > > This class should not know about WKView! Instead, takeSnapshot() should really do all its work through the PageClient interface. > > > > For classes that are Mac only I see no problem exposing the view directly. Maybe this is not a Mac only class though. I have been trying to keep a division still. If something wants to know about the WKView, it should be in UIProcess/API/Cocoa or UIProcess/API/Mac. (In reply to comment #8) > (In reply to comment #7) > > (In reply to comment #5) > > > > > > > > This class should not know about WKView! Instead, takeSnapshot() should really do all its work through the PageClient interface. > > > > > > > For classes that are Mac only I see no problem exposing the view directly. Maybe this is not a Mac only class though. > > I have been trying to keep a division still. If something wants to know about the WKView, it should be in UIProcess/API/Cocoa or UIProcess/API/Mac. And that's why PageClient is a clusterfuck of random unrelated functions... Created attachment 222054 [details]
patch
|