Changeset 135935 in webkit
- Timestamp:
- Nov 27, 2012, 3:56:54 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r135925 r135935 1 2012-11-27 Yael Aharon <yael.aharon@intel.com> 2 3 [EFL][WK2] 3D pixel tests are failing 4 https://bugs.webkit.org/show_bug.cgi?id=102833 5 6 Reviewed by Kenneth Rohde Christiansen. 7 8 Added an API for generating a snapshot, to be used from WebKitTestRunner. 9 10 * PlatformEfl.cmake: 11 * UIProcess/API/C/efl/WKView.cpp: 12 (WKViewGetSnapshot): 13 * UIProcess/API/C/efl/WKView.h: 14 * UIProcess/API/efl/EwkViewImpl.cpp: 15 (EwkViewImpl::onFaviconChanged): 16 (EwkViewImpl::takeSnapshot): 17 * UIProcess/API/efl/EwkViewImpl.h: 18 (EwkViewImpl): 19 * UIProcess/API/efl/SnapshotImageGL.cpp: Added. 20 (getImageFromCurrentTexture): 21 * UIProcess/API/efl/SnapshotImageGL.h: Added. 22 1 23 2012-11-27 Tim Horton <timothy_horton@apple.com> 2 24 -
trunk/Source/WebKit2/PlatformEfl.cmake
r135394 r135935 45 45 UIProcess/API/efl/EvasGLContext.cpp 46 46 UIProcess/API/efl/EvasGLSurface.cpp 47 UIProcess/API/efl/SnapshotImageGL.cpp 47 48 UIProcess/API/efl/ewk_auth_request.cpp 48 49 UIProcess/API/efl/ewk_back_forward_list.cpp -
trunk/Source/WebKit2/UIProcess/API/C/efl/WKView.cpp
r135287 r135935 43 43 return viewImpl->wkPage(); 44 44 } 45 46 WKImageRef WKViewGetSnapshot(WKViewRef viewRef) 47 { 48 EwkViewImpl* viewImpl = EwkViewImpl::fromEvasObject(toImpl(viewRef)); 49 50 return viewImpl->takeSnapshot(); 51 } -
trunk/Source/WebKit2/UIProcess/API/C/efl/WKView.h
r135287 r135935 35 35 WK_EXPORT WKPageRef WKViewGetPage(WKViewRef view); 36 36 37 WK_EXPORT WKImageRef WKViewGetSnapshot(WKViewRef viewRef); 38 37 39 #ifdef __cplusplus 38 40 } -
trunk/Source/WebKit2/UIProcess/API/efl/EwkViewImpl.cpp
r135609 r135935 36 36 #include "PageUIClientEfl.h" 37 37 #include "ResourceLoadClientEfl.h" 38 #include "SnapshotImageGL.h" 38 39 #include "WKDictionary.h" 39 40 #include "WKGeometry.h" … … 41 42 #include "WKString.h" 42 43 #include "WebContext.h" 44 #include "WebImage.h" 43 45 #include "WebPageGroup.h" 44 46 #include "WebPageProxy.h" … … 63 65 #include <WebCore/CairoUtilitiesEfl.h> 64 66 #include <WebCore/Cursor.h> 67 #include <WebKit2/WKImageCairo.h> 65 68 66 69 #if ENABLE(VIBRATION) … … 1013 1016 viewImpl->informIconChange(); 1014 1017 } 1018 1019 WKImageRef EwkViewImpl::takeSnapshot() 1020 { 1021 Ewk_View_Smart_Data* sd = smartData(); 1022 #if USE(ACCELERATED_COMPOSITING) 1023 if (!m_isHardwareAccelerated) 1024 #endif 1025 return WKImageCreateFromCairoSurface(createSurfaceForImage(sd->image).get(), 0); 1026 1027 #if USE(ACCELERATED_COMPOSITING) 1028 Evas_Native_Surface* nativeSurface = evas_object_image_native_surface_get(sd->image); 1029 unsigned char* buffer = getImageFromCurrentTexture(sd->view.w, sd->view.h, nativeSurface->data.opengl.texture_id); 1030 RefPtr<cairo_surface_t> surface = adoptRef(cairo_image_surface_create_for_data(buffer, CAIRO_FORMAT_ARGB32, sd->view.w, sd->view.h, sd->view.w * 4)); 1031 WKImageRef image = WKImageCreateFromCairoSurface(surface.get(), 0); 1032 delete[] buffer; 1033 1034 return image; 1035 #endif 1036 } -
trunk/Source/WebKit2/UIProcess/API/efl/EwkViewImpl.h
r135514 r135935 216 216 void setDrawsBackground(bool enable) { m_setDrawsBackground = enable; } 217 217 218 WKImageRef takeSnapshot(); 219 218 220 private: 219 221 inline Ewk_View_Smart_Data* smartData() const; -
trunk/Tools/ChangeLog
r135930 r135935 1 2012-11-27 Yael Aharon <yael.aharon@intel.com> 2 3 [EFL][WK2] 3D pixel tests are failing 4 https://bugs.webkit.org/show_bug.cgi?id=102833 5 6 Reviewed by Kenneth Rohde Christiansen. 7 8 Generate a snapshot of the view in the UI process instead of the web process. 9 We have to use Texture Mapper in order to correctly paint 3D transforms etc. 10 11 * WebKitTestRunner/TestInvocation.h: 12 (TestInvocation): 13 * WebKitTestRunner/cairo/TestInvocationCairo.cpp: 14 (WTR::writeFunction): 15 (WTR::paintRepaintRectOverlay): 16 (WTR): 17 (WTR::TestInvocation::forceRepaintDoneCallback): 18 (WTR::TestInvocation::dumpPixelsAndCompareWithExpected): 19 * WebKitTestRunner/efl/PlatformWebViewEfl.cpp: 20 (WTR::PlatformWebView::windowSnapshotImage): 21 1 22 2012-11-27 Adam Barth <abarth@webkit.org> 2 23 -
trunk/Tools/WebKitTestRunner/TestInvocation.h
r133768 r135935 52 52 bool compareActualHashToExpectedAndDumpResults(const char[33]); 53 53 54 #if PLATFORM(QT) 54 #if PLATFORM(QT) || PLATFORM(EFL) 55 55 static void forceRepaintDoneCallback(WKErrorRef, void* context); 56 56 void forceRepaintDone(); -
trunk/Tools/WebKitTestRunner/cairo/TestInvocationCairo.cpp
r134074 r135935 31 31 32 32 #include "PixelDumpSupport.h" 33 #include "PlatformWebView.h" 34 #include "TestController.h" 33 35 #include <WebKit2/WKImageCairo.h> 34 36 #include <cairo/cairo.h> … … 62 64 } 63 65 64 static cairo_status_t writeFunction(void* closure, const unsigned char* data, unsigned intlength)66 static cairo_status_t writeFunction(void* closure, const unsigned char* data, unsigned length) 65 67 { 66 68 Vector<unsigned char>* in = reinterpret_cast<Vector<unsigned char>*>(closure); … … 105 107 } 106 108 109 #if PLATFORM(EFL) 110 void TestInvocation::forceRepaintDoneCallback(WKErrorRef, void *context) 111 { 112 static_cast<TestInvocation*>(context)->m_gotRepaint = true; 113 TestController::shared().notifyDone(); 114 } 115 #endif 116 107 117 void TestInvocation::dumpPixelsAndCompareWithExpected(WKImageRef wkImage, WKArrayRef repaintRects) 108 118 { 119 #if USE(ACCELERATED_COMPOSITING) && PLATFORM(EFL) 120 UNUSED_PARAM(wkImage); 121 122 cairo_surface_t* surface; 123 124 WKPageRef page = TestController::shared().mainWebView()->page(); 125 WKPageForceRepaint(page, this, &forceRepaintDoneCallback); 126 127 TestController::shared().runUntil(m_gotRepaint, TestController::ShortTimeout); 128 129 if (!m_gotRepaint) { 130 m_error = true; 131 m_errorMessage = "Timed out waiting for repaint\n"; 132 m_webProcessIsUnrensponsive = true; 133 return; 134 } 135 136 surface = WKImageCreateCairoSurface(TestController::shared().mainWebView()->windowSnapshotImage().get()); 137 #else 109 138 cairo_surface_t* surface = WKImageCreateCairoSurface(wkImage); 139 #endif 110 140 111 141 if (repaintRects) -
trunk/Tools/WebKitTestRunner/efl/PlatformWebViewEfl.cpp
r135287 r135935 25 25 #include "WebKit2/WKAPICast.h" 26 26 #include <Ecore_Evas.h> 27 #include <WebCore/RefPtrCairo.h> 28 #include <WebKit2/WKImageCairo.h> 29 #include <cairo.h> 27 30 28 31 using namespace WebKit; … … 125 128 WKRetainPtr<WKImageRef> PlatformWebView::windowSnapshotImage() 126 129 { 127 // FIXME: implement to capture pixels in the UI process, 128 // which may be necessary to capture things like 3D transforms. 129 return 0; 130 Ecore_Evas* ee = ecore_evas_ecore_evas_get(evas_object_evas_get(m_view)); 131 ASSERT(ee); 132 133 int width; 134 int height; 135 ecore_evas_geometry_get(ee, 0, 0, &width, &height); 136 ASSERT(width > 0 && height > 0); 137 138 return adoptWK(WKViewGetSnapshot(toAPI(m_view))); 130 139 } 131 140
Note:
See TracChangeset
for help on using the changeset viewer.