[Cairo] Separate image encoding from dataURL construction
authornoel.gordon@gmail.com <noel.gordon@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 16 Apr 2012 02:14:07 +0000 (02:14 +0000)
committernoel.gordon@gmail.com <noel.gordon@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 16 Apr 2012 02:14:07 +0000 (02:14 +0000)
commit6de75b8b68d8ca75f56ea9db4d9eb5adbe8bb75b
tree296540645729d468c3703a153285cc75f3976a25
parent2aa43654ad196330fd95e93c33022ba50f9c16be
[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
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp