[Qt] Make ImageBufferQt use premultiplied converting functions in Color.h instead...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 8 Oct 2012 19:14:53 +0000 (19:14 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 8 Oct 2012 19:14:53 +0000 (19:14 +0000)
commitafe3f0591111c3c66e071f148f8b9934c63acfe3
tree3c8319121bc46439acb82a8d12677d442ea96b38
parent1590ec6807a73b93f3500ca89e109aab2bb442c2
[Qt] Make ImageBufferQt use premultiplied converting functions in Color.h instead of its own mechanism.
https://bugs.webkit.org/show_bug.cgi?id=98582

Patch by Huang Dongsung <luxtella@company100.net> on 2012-10-08
Reviewed by Eric Seidel.

Source/WebCore:

Only Qt port failed canvas/philip/tests/2d.imageData.put.unchanged.html because
ImageBufferQt converts from or to a premultiplied color using its own code. When
we convert twice from an unmultiplied color to a premultiplied color and then to
an unmultiplied color using this code, the calculated result are pretty
different against the input color. It is why Gtk passes this test although Qt
fails. Gtk port uses them in Color.h.

In addition, Qt should use the functions in Color.h to reduce duplicated codes.

Tests: canvas/philip/tests/2d.imageData.put.unchanged.html: Fixed a test case

* platform/graphics/qt/ImageBufferQt.cpp:
(WebCore::getImageData):
(WebCore::convertBGRAToRGBA):
(WebCore::ImageBuffer::putByteArray):

LayoutTests:

Unskipping canvas/philip/tests/2d.imageData.put.unchanged.html that is passing.

* platform/qt/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@130672 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/platform/qt/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/qt/ImageBufferQt.cpp