Fix nonpremultiplied webgl toDataURL to jpeg
https://bugs.webkit.org/show_bug.cgi?id=68366
Source/WebCore:
The canvas spec says that toDataURL to formats without an alpha must
be "composited onto a solid black background using the source-over
operator." Do that.
Patch by John Bauman <jbauman@chromium.org> on 2011-09-26
Reviewed by Kenneth Russell.
* platform/graphics/cg/ImageBufferCG.cpp:
(WebCore::CGImageToDataURL):
(WebCore::ImageBuffer::toDataURL):
(WebCore::ImageDataToDataURL):
* platform/image-encoders/skia/JPEGImageEncoder.cpp:
(WebCore::RGBAtoRGB):
LayoutTests:
Update the premultiplyalpha-test from the WebGL conformance tests.
Also use the correct expected result for toDataURL.jpeg.alpha.html.
Patch by John Bauman <jbauman@chromium.org> on 2011-09-26
Reviewed by Kenneth Russell.
* fast/canvas/webgl/premultiplyalpha-test-expected.txt:
* fast/canvas/webgl/premultiplyalpha-test.html:
* platform/mac/canvas/philip/tests/toDataURL.jpeg.alpha-expected.txt:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@96000
268f45cc-cd09-0410-ab3c-
d52691b4dbfc