a WKImage can provide its image data as a CGImageRef (via WKImageCreateCGImage), but we don't have the ability to go the other way around, to create a WKImage from CGImage data.
Created attachment 85426 [details] patch
Comment on attachment 85426 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=85426&action=review > Source/WebKit2/Shared/API/c/cg/WKImageCG.h:31 > +#include <WebKit2/WKImage.h> This include should not be necessary. If it is, please sort these. > Source/WebKit2/Shared/API/c/cg/WKImageCG.h:40 > +WK_EXPORT WKImageRef WKImageCreateFromCGImage(CGImageRef imageRef, WKSize size, WKImageOptions options); Why not just get the size from the CGImageRef?
Created attachment 85453 [details] patch without WKSize the inclusion of WKImage.h is needed for WKImageOptions.
committed http://trac.webkit.org/projects/webkit/changeset/81087