Changeset 167643 in webkit
- Timestamp:
- Apr 21, 2014 6:56:04 PM (10 years ago)
- Location:
- trunk/Tools
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r167627 r167643 1 2014-04-21 Martin Robinson <mrobinson@igalia.com> 2 3 [GTK] Should have the ability to output composited contents during layout testing 4 https://bugs.webkit.org/show_bug.cgi?id=131864 5 6 Reviewed by Philippe Normand. 7 8 * WebKitTestRunner/cairo/TestInvocationCairo.cpp: 9 (WTR::TestInvocation::dumpPixelsAndCompareWithExpected): Add a path that paints the widget contents 10 to an image surface. We run the main loop a bit to match the implementation from WebKit1 and EFL. 11 * WebKitTestRunner/gtk/PlatformWebViewGtk.cpp: 12 (WTR::PlatformWebView::windowSnapshotImage): Use the new UI-process path on GTK+. 13 1 14 2014-04-21 Sam Weinig <sam@webkit.org> 2 15 -
trunk/Tools/WebKitTestRunner/cairo/TestInvocationCairo.cpp
r163079 r167643 109 109 void TestInvocation::dumpPixelsAndCompareWithExpected(WKImageRef wkImage, WKArrayRef repaintRects) 110 110 { 111 #if PLATFORM(EFL) 111 #if PLATFORM(EFL) || PLATFORM(GTK) 112 112 UNUSED_PARAM(wkImage); 113 113 cairo_surface_t* surface = WKImageCreateCairoSurface(TestController::shared().mainWebView()->windowSnapshotImage().get()); -
trunk/Tools/WebKitTestRunner/gtk/PlatformWebViewGtk.cpp
r164882 r167643 29 29 #include "PlatformWebView.h" 30 30 31 #include <WebKit2/WKImageCairo.h> 31 32 #include <WebKit2/WKViewPrivate.h> 32 33 #include <gtk/gtk.h> … … 121 122 WKRetainPtr<WKImageRef> PlatformWebView::windowSnapshotImage() 122 123 { 123 // FIXME: implement to capture pixels in the UI process, 124 // which may be necessary to capture things like 3D transforms. 125 return 0; 124 int width = gtk_widget_get_allocated_width(GTK_WIDGET(m_view)); 125 int height = gtk_widget_get_allocated_height(GTK_WIDGET(m_view)); 126 127 while (gtk_events_pending()) 128 gtk_main_iteration(); 129 130 cairo_surface_t* imageSurface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, width, height); 131 132 cairo_t* context = cairo_create(imageSurface); 133 gtk_widget_draw(GTK_WIDGET(m_view), context); 134 cairo_destroy(context); 135 136 WKRetainPtr<WKImageRef> wkImage = adoptWK(WKImageCreateFromCairoSurface(imageSurface, 0 /* options */)); 137 138 cairo_surface_destroy(imageSurface); 139 return wkImage; 126 140 } 127 141
Note: See TracChangeset
for help on using the changeset viewer.