[Cairo] Separate image encoding from dataURL construction
https://bugs.webkit.org/show_bug.cgi?id=83975
Reviewed by Martin Robinson.
Remove the implicit assumption that a dataURL is the only desired output format
of the image encoding phase.
No new tests. Covered by existing canvas toDataURL tests.
* platform/graphics/cairo/ImageBufferCairo.cpp:
(WebCore::writeFunction): Rename closure to output.
(WebCore::encodeImage): Output the encoded image to the provided Vector<char>.
PNG format is only supported per the Cairo encoding MIMETypeRegistry.
(WebCore):
(WebCore::ImageBuffer::toDataURL): Refactor to use encodeImage().
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@114216
268f45cc-cd09-0410-ab3c-
d52691b4dbfc