WebKit2: Add API for getting snapshots
authorweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 28 Dec 2010 00:01:08 +0000 (00:01 +0000)
committerweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 28 Dec 2010 00:01:08 +0000 (00:01 +0000)
commit0d664d0aa06c3225a6152761a6c6e3a37e5ce686
treef765213011ad4b57ea579879ad930d8b99bae947
parentc5be70f22f8c2715a15e2f62e7ea47c798574918
WebKit2: Add API for getting snapshots
https://bugs.webkit.org/show_bug.cgi?id=51656

Reviewed by Anders Carlsson.

* Shared/API/c/WKBase.h:
* Shared/API/c/WKImage.cpp: Added.
(WKImageGetTypeID):
(WKImageCreate):
(WKImageGetSize):
* Shared/API/c/WKImage.h: Added.
* Shared/WebImage.cpp: Added.
(WebKit::WebImage::create):
(WebKit::WebImage::size):
* Shared/WebImage.h: Added.
(WebKit::WebImage::backingStore):
(WebKit::WebImage::WebImage):
(WebKit::WebImage::type):
Add a general purpose API image class.

* Shared/API/c/cg: Added.
* Shared/API/c/cg/WKImageCG.cpp: Added.
(WKImageCreateCGImage):
* Shared/API/c/cg/WKImageCG.h: Added.
Add function to convert a WKImageRef to a CGImageRef for platforms that use CG.

* Shared/API/c/WKSharedAPICast.h:
(WebKit::toFloatRect):
(WebKit::toIntSize):
(WebKit::toIntPoint):
(WebKit::toIntRect):
(WebKit::toImageOptions):
Make conversion functions that are ambiguous more explicit.

* Shared/APIObject.h:
* Shared/BackingStore.h:
(WebKit::BackingStore::isBackedBySharedMemory):
* Shared/ImageOptions.h: Added.
* Shared/UserMessageCoders.h:
(WebKit::UserMessageEncoder::baseEncode):
(WebKit::UserMessageDecoder::baseDecode):
Allow a WKImageRef to be passed in user messages.  Right now, it only
works if the image is sharable.

* UIProcess/API/C/WKPage.cpp:
(WKPageScaleWebView):
* UIProcess/WebUIClient.cpp:
(WebKit::WebUIClient::windowFrame):
Use the more explicit conversion function name.

* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageCreateSnapshotInViewCoordinates):
(WKBundlePageCreateSnapshotInDocumentCoordinates):
* WebProcess/InjectedBundle/API/c/WKBundlePage.h:
* WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
(WKBundlePageOverlaySetNeedsDisplay):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::snapshotInViewCoordinates):
(WebKit::WebPage::snapshotInDocumentCoordinates):
Add function to take the snapshot.

* WebProcess/WebPage/WebPage.h:
* WebKit2.pro:
* WebKit2.xcodeproj/project.pbxproj:
* win/WebKit2.vcproj:
Add new files.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@74698 268f45cc-cd09-0410-ab3c-d52691b4dbfc
23 files changed:
WebKit2/ChangeLog
WebKit2/Shared/API/c/WKBase.h
WebKit2/Shared/API/c/WKImage.cpp [new file with mode: 0644]
WebKit2/Shared/API/c/WKImage.h [new file with mode: 0644]
WebKit2/Shared/API/c/WKSharedAPICast.h
WebKit2/Shared/API/c/cg/WKImageCG.cpp [new file with mode: 0644]
WebKit2/Shared/API/c/cg/WKImageCG.h [new file with mode: 0644]
WebKit2/Shared/APIObject.h
WebKit2/Shared/BackingStore.h
WebKit2/Shared/ImageOptions.h [new file with mode: 0644]
WebKit2/Shared/UserMessageCoders.h
WebKit2/Shared/WebImage.cpp [new file with mode: 0644]
WebKit2/Shared/WebImage.h [new file with mode: 0644]
WebKit2/UIProcess/API/C/WKPage.cpp
WebKit2/UIProcess/WebUIClient.cpp
WebKit2/WebKit2.pro
WebKit2/WebKit2.xcodeproj/project.pbxproj
WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp
WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.h
WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp
WebKit2/WebProcess/WebPage/WebPage.cpp
WebKit2/WebProcess/WebPage/WebPage.h
WebKit2/win/WebKit2.vcproj