[GTK] Remove the GDK dependency from ImageDiff
authorcarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 10 Apr 2017 11:48:22 +0000 (11:48 +0000)
committercarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 10 Apr 2017 11:48:22 +0000 (11:48 +0000)
commitbbe5d71336b5646c034efcba2e89d45e0d32c512
tree1cdb438b9d4a8358f3d3da42919f33bf52ac011a
parentd0a1ea5bd31638f3e3a300c5516df6c2e8934f17
[GTK] Remove the GDK dependency from ImageDiff
https://bugs.webkit.org/show_bug.cgi?id=85299

Reviewed by Žan Doberšek.

Add a cairo only implementation of ImageDiff. We currently have 3 different implementations of ImageDiff: the
Gdk based one used by GTK+ port, the cairo based one used by WinCairo and the CG based one. Most of the code is
actually common in all of them, but it's duplicated. So, I've taken advantage of this patch to refactor the
ImageDiff code to share the common implementation. This patch adds the cross-platform code, and the cairo
implementation and enables it in the GTK+ port. In follow up patches we can move WinCairo to this implementation
and also add CG implementation.

* ImageDiff/CMakeLists.txt:
* ImageDiff/Cairo.cmake: Added.
* ImageDiff/ImageDiff.cpp: Added.
(main):
* ImageDiff/PlatformGTK.cmake:
* ImageDiff/PlatformImage.cpp: Added.
(ImageDiff::PlatformImage::isCompatible):
(ImageDiff::PlatformImage::difference):
* ImageDiff/PlatformImage.h: Added.
* ImageDiff/cairo/PlatformImageCairo.cpp: Added.
(ImageDiff::PlatformImage::createFromStdin):
(ImageDiff::PlatformImage::createFromDiffData):
(ImageDiff::PlatformImage::PlatformImage):
(ImageDiff::PlatformImage::~PlatformImage):
(ImageDiff::PlatformImage::width):
(ImageDiff::PlatformImage::height):
(ImageDiff::PlatformImage::rowBytes):
(ImageDiff::PlatformImage::hasAlpha):
(ImageDiff::PlatformImage::pixels):
(ImageDiff::PlatformImage::writeAsPNGToStdout):
* ImageDiff/gtk/ImageDiff.cpp: Removed.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@215179 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Tools/ChangeLog
Tools/ImageDiff/CMakeLists.txt
Tools/ImageDiff/Cairo.cmake [new file with mode: 0644]
Tools/ImageDiff/ImageDiff.cpp [new file with mode: 0644]
Tools/ImageDiff/PlatformGTK.cmake
Tools/ImageDiff/PlatformImage.cpp [new file with mode: 0644]
Tools/ImageDiff/PlatformImage.h [new file with mode: 0644]
Tools/ImageDiff/cairo/PlatformImageCairo.cpp [new file with mode: 0644]
Tools/ImageDiff/gtk/ImageDiff.cpp [deleted file]