Changeset 216576 in webkit
- Timestamp:
- May 10, 2017 1:16:15 AM (7 years ago)
- Location:
- trunk/Tools
- Files:
-
- 1 added
- 3 deleted
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r216575 r216576 1 2017-05-10 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 ImageDiff: Add CG implementation for new ImageDiff 4 https://bugs.webkit.org/show_bug.cgi?id=170608 5 6 Reviewed Alex Christensen. 7 8 * DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj: 9 * DumpRenderTree/win/ImageDiffCairo.cpp: Removed. 10 * DumpRenderTree/win/ImageDiffWin.cpp: Removed. 11 * ImageDiff/CMakeLists.txt: 12 * ImageDiff/Cairo.cmake: 13 * ImageDiff/ImageDiff.cpp: 14 (main): 15 * ImageDiff/ImageDiff.xcodeproj/project.pbxproj: 16 * ImageDiff/PlatformImage.cpp: 17 * ImageDiff/PlatformImage.h: 18 * ImageDiff/cairo/PlatformImageCairo.cpp: 19 * ImageDiff/cg/ImageDiff.cpp: Removed. 20 * ImageDiff/cg/PlatformImageCG.cpp: Added. 21 (ImageDiff::PlatformImage::createFromStdin): 22 (ImageDiff::PlatformImage::createFromDiffData): 23 (ImageDiff::PlatformImage::PlatformImage): 24 (ImageDiff::PlatformImage::~PlatformImage): 25 (ImageDiff::PlatformImage::width): 26 (ImageDiff::PlatformImage::height): 27 (ImageDiff::PlatformImage::rowBytes): 28 (ImageDiff::PlatformImage::hasAlpha): 29 (ImageDiff::PlatformImage::pixels): 30 (ImageDiff::PlatformImage::writeAsPNGToStdout): 31 1 32 2017-05-10 Zan Dobersek <zdobersek@igalia.com> 2 33 -
trunk/Tools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj
r216288 r216576 399 399 BCB2848C0CFA8221007E533E /* PixelDumpSupportMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; name = PixelDumpSupportMac.mm; path = mac/PixelDumpSupportMac.mm; sourceTree = "<group>"; }; 400 400 BCB284B20CFA82CB007E533E /* ApplicationServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ApplicationServices.framework; path = /System/Library/Frameworks/ApplicationServices.framework; sourceTree = "<absolute>"; }; 401 BCB284F30CFA84F2007E533E /* ImageDiffCG.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = ImageDiffCG.cpp; path = cg/ImageDiffCG.cpp; sourceTree = "<group>"; };402 401 BCD08A580E10496B00A7D0C1 /* AccessibilityController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AccessibilityController.h; sourceTree = "<group>"; }; 403 402 BCD08B390E1057EF00A7D0C1 /* AccessibilityController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AccessibilityController.cpp; sourceTree = "<group>"; }; … … 805 804 53CBB830134E42F3001CE6A4 /* CyclicRedundancyCheck.cpp */, 806 805 53CBB831134E42F3001CE6A4 /* CyclicRedundancyCheck.h */, 807 BCB284F30CFA84F2007E533E /* ImageDiffCG.cpp */,808 806 8465E2C60FFA8DF2003B8342 /* PixelDumpSupport.cpp */, 809 807 BCB2848A0CFA820F007E533E /* PixelDumpSupport.h */, -
trunk/Tools/ImageDiff/CMakeLists.txt
r215179 r216576 8 8 ) 9 9 10 list(APPENDIMAGE_DIFF_INCLUDE_DIRECTORIES10 set(IMAGE_DIFF_INCLUDE_DIRECTORIES 11 11 ${IMAGE_DIFF_DIR} 12 )13 14 set(IMAGE_DIFF_LIBRARIES15 WTF16 12 ) 17 13 -
trunk/Tools/ImageDiff/Cairo.cmake
r215179 r216576 10 10 ${CAIRO_LIBRARIES} 11 11 ) 12 13 add_definitions(-DUSE_CAIRO=1) -
trunk/Tools/ImageDiff/ImageDiff.cpp
r216504 r216576 26 26 */ 27 27 28 #include "config.h" 28 // FIXME: We need to be able to include these defines from a config.h somewhere. 29 #define JS_EXPORT_PRIVATE 30 29 31 #include "PlatformImage.h" 30 32 #include <algorithm> … … 33 35 #include <string.h> 34 36 35 #if PLATFORM(WIN)37 #ifdef _WIN32 36 38 #include <fcntl.h> 37 39 #include <io.h> … … 40 42 using namespace ImageDiff; 41 43 42 #if OS(WINDOWS)44 #ifdef _WIN32 43 45 #define FORMAT_SIZE_T "Iu" 44 46 #else … … 48 50 int main(int argc, const char* argv[]) 49 51 { 50 #if PLATFORM(WIN)52 #ifdef _WIN32 51 53 _setmode(0, _O_BINARY); 52 54 _setmode(1, _O_BINARY); -
trunk/Tools/ImageDiff/ImageDiff.xcodeproj/project.pbxproj
r216207 r216576 8 8 9 9 /* Begin PBXBuildFile section */ 10 31DF42D51EBBBC220096ED44 /* ImageDiff.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 31DF42C21EBBBB550096ED44 /* ImageDiff.cpp */; }; 10 7A41C8F01EC1F8FF003DBC76 /* PlatformImageCG.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7A41C8EF1EC1F8FF003DBC76 /* PlatformImageCG.cpp */; }; 11 7A41C8F21EC1F919003DBC76 /* ImageDiff.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7A41C8F11EC1F919003DBC76 /* ImageDiff.cpp */; }; 12 7A41C8F41EC1F935003DBC76 /* PlatformImage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7A41C8F31EC1F935003DBC76 /* PlatformImage.cpp */; }; 11 13 /* End PBXBuildFile section */ 12 14 … … 24 26 25 27 /* Begin PBXFileReference section */ 26 31DF42C21EBBBB550096ED44 /* ImageDiff.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = ImageDiff.cpp; path = cg/ImageDiff.cpp; sourceTree = SOURCE_ROOT; };27 28 31DF42C41EBBBBB90096ED44 /* Base.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Base.xcconfig; sourceTree = "<group>"; }; 28 29 31DF42C51EBBBBB90096ED44 /* DebugRelease.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = DebugRelease.xcconfig; sourceTree = "<group>"; }; 29 30 31DF42C61EBBBBB90096ED44 /* ImageDiff.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = ImageDiff.xcconfig; sourceTree = "<group>"; }; 30 31 31DF42CC1EBBBBFE0096ED44 /* ImageDiff */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = ImageDiff; sourceTree = BUILT_PRODUCTS_DIR; }; 32 7A41C8EF1EC1F8FF003DBC76 /* PlatformImageCG.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PlatformImageCG.cpp; sourceTree = "<group>"; }; 33 7A41C8F11EC1F919003DBC76 /* ImageDiff.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ImageDiff.cpp; sourceTree = "<group>"; }; 34 7A41C8F31EC1F935003DBC76 /* PlatformImage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PlatformImage.cpp; sourceTree = "<group>"; }; 35 7A41C8F51EC1F946003DBC76 /* PlatformImage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformImage.h; sourceTree = "<group>"; }; 31 36 /* End PBXFileReference section */ 32 37 … … 45 50 isa = PBXGroup; 46 51 children = ( 52 7A41C8F11EC1F919003DBC76 /* ImageDiff.cpp */, 53 7A41C8F31EC1F935003DBC76 /* PlatformImage.cpp */, 54 7A41C8F51EC1F946003DBC76 /* PlatformImage.h */, 47 55 31DF42C31EBBBB5E0096ED44 /* Configurations */, 48 56 31DF42C01EBBBB210096ED44 /* cg */, … … 54 62 isa = PBXGroup; 55 63 children = ( 56 31DF42C21EBBBB550096ED44 /* ImageDiff.cpp */,64 7A41C8EF1EC1F8FF003DBC76 /* PlatformImageCG.cpp */, 57 65 ); 58 66 path = cg; … … 134 142 buildActionMask = 2147483647; 135 143 files = ( 136 31DF42D51EBBBC220096ED44 /* ImageDiff.cpp in Sources */, 144 7A41C8F41EC1F935003DBC76 /* PlatformImage.cpp in Sources */, 145 7A41C8F21EC1F919003DBC76 /* ImageDiff.cpp in Sources */, 146 7A41C8F01EC1F8FF003DBC76 /* PlatformImageCG.cpp in Sources */, 137 147 ); 138 148 runOnlyForDeploymentPostprocessing = 0; -
trunk/Tools/ImageDiff/PlatformImage.cpp
r215179 r216576 26 26 */ 27 27 28 #include "config.h"29 28 #include "PlatformImage.h" 30 29 31 30 #include <algorithm> 31 #include <cstdlib> 32 32 33 33 namespace ImageDiff { -
trunk/Tools/ImageDiff/PlatformImage.h
r215179 r216576 26 26 #include <cmath> 27 27 #include <memory> 28 #include <wtf/Platform.h>29 28 30 #if USE(CAIRO)29 #if defined(USE_CAIRO) && USE_CAIRO 31 30 typedef struct _cairo_surface cairo_surface_t; 31 #else 32 typedef struct CGImage *CGImageRef; 32 33 #endif 33 34 … … 39 40 static std::unique_ptr<PlatformImage> createFromDiffData(void*, size_t width, size_t height); 40 41 41 #if USE(CAIRO)42 #if defined(USE_CAIRO) && USE_CAIRO 42 43 PlatformImage(cairo_surface_t*); 44 #else 45 PlatformImage(CGImageRef); 43 46 #endif 44 47 ~PlatformImage(); … … 54 57 55 58 private: 56 #if USE(CAIRO)59 #if defined(USE_CAIRO) && USE_CAIRO 57 60 cairo_surface_t* m_image; 61 #else 62 CGImageRef m_image; 63 mutable void* m_buffer { nullptr }; 58 64 #endif 59 65 }; -
trunk/Tools/ImageDiff/PlatformMac.cmake
r216207 r216576 1 list(APPEND IMAGE_DIFF_SOURCES 2 ${IMAGE_DIFF_DIR}/cg/PlatformImageCG.cpp 3 ) 1 4 list(APPEND IMAGE_DIFF_LIBRARIES 2 CFNetwork3 CoreGraphics4 CoreText5 )6 set(IMAGE_DIFF_SOURCES7 ${IMAGE_DIFF_DIR}/cg/ImageDiff.cpp8 )9 list(APPEND ImageDiff_LIBRARIES10 5 CoreFoundation 11 6 CoreGraphics -
trunk/Tools/ImageDiff/PlatformWin.cmake
r216504 r216576 1 1 if (${WTF_PLATFORM_WIN_CAIRO}) 2 add_definitions(-DUSE_CAIRO=1)3 2 include(Cairo.cmake) 4 3 else () -
trunk/Tools/ImageDiff/cairo/PlatformImageCairo.cpp
r215179 r216576 24 24 */ 25 25 26 #include "config.h"27 26 #include "PlatformImage.h" 28 27 … … 30 29 #include <stdio.h> 31 30 32 #if OS(WINDOWS)31 #ifdef _WIN32 33 32 #define FORMAT_SIZE_T "Iu" 34 33 #else
Note: See TracChangeset
for help on using the changeset viewer.