Provide a mechanism to specify the maximum size of WKThumbnailView snapshots
authortimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 13 Sep 2016 21:09:35 +0000 (21:09 +0000)
committertimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 13 Sep 2016 21:09:35 +0000 (21:09 +0000)
commit78a8614dad59b5fef5df8230fd9d951d9ee05d07
tree35752d334bcbb8b22a31c5f23eb215da598cc3d5
parent017ace93ff96f6f64350583552595b3cb808c285
Provide a mechanism to specify the maximum size of WKThumbnailView snapshots
https://bugs.webkit.org/show_bug.cgi?id=161896
<rdar://problem/28229827>

Reviewed by Simon Fraser.

Some clients know that their thumbnail views will only be displayed up to
a specific size that is significantly smaller than the WKView size. Allow
them to avoid wasting lots of memory on unnecessarily large snapshots.

* UIProcess/API/Cocoa/_WKThumbnailView.h:
* UIProcess/API/Cocoa/_WKThumbnailView.mm:
(-[_WKThumbnailView requestSnapshot]):
(-[_WKThumbnailView _requestSnapshotIfNeeded]):
(-[_WKThumbnailView setMaximumSnapshotSize:]):
Add a maximumSnapshotSize property which can be changed dynamically.

* TestWebKitAPI/Tests/WebKit2/WKThumbnailView.mm:
(TestWebKitAPI::TEST):
Add a test for the new property.
Also fix the old new test to run on arbitrary scale displays without failing.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@205878 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/Cocoa/_WKThumbnailView.h
Source/WebKit2/UIProcess/API/Cocoa/_WKThumbnailView.mm
Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WebKit2/WKThumbnailView.mm