[EFL] Fix problems with the pixel dump.
https://bugs.webkit.org/show_bug.cgi?id=131265

Patch by Hyowon Kim <hw1008.kim@samsung.com> on 2014-04-15
Reviewed by Gyuyoung Kim.

Painting and compositing paths of WebKit-EFL were totally modified from r166768.
However pixel dump codes still call deprecated functions like ewk_view_paint(),
which causes that nothing is drawn.

This patch adds new member functions to AcceleratedCompositingContext to support pixel dump.
One of new functions is AcceleratedCompositingContext::extractImageData(),
which replaces deprecated function calls. Besides the extractImageData() is invoked by
ewk_view_screenshot_contents_get() in order to take the visible content displayed on the EFL webview.

Source/WebCore:
* platform/graphics/cairo/CairoUtilities.cpp:
(WebCore::flipImageSurfaceVertically): Flip pixel data of given cairo_surface_t vertically up/down.
Whereas Cairo uses the top-left corner as being 0,0 of the coordinate system,
OpenGL uses the bottom-left corner being 0,0.
So we need to vertically flip resultant images taken by glReadPixels().
* platform/graphics/cairo/CairoUtilities.h:

Source/WebKit/efl:
* WebCoreSupport/AcceleratedCompositingContextEfl.cpp:
(WebCore::AcceleratedCompositingContext::AcceleratedCompositingContext):
Create TextureMapper with a proper backend.
(WebCore::AcceleratedCompositingContext::flushPendingLayerChanges):
Revise a null check for m_rootLayer.
(WebCore::AcceleratedCompositingContext::paintToGraphicsContext):
Remove a creation check for TextureMapperGL.
(WebCore::AcceleratedCompositingContext::paintToCurrentGLContext):
Ditto.
(WebCore::AcceleratedCompositingContext::extractImageData):
Extract image data from the view and copy it to given Evas_Object.
(WebCore::AcceleratedCompositingContext::getImageData):
Get image data from the view and return it as cairo_surface_t on software mode.
(WebCore::AcceleratedCompositingContext::getImageDataGL):
Get image data from the view and return it as cairo_surface_t on GL mode.
* WebCoreSupport/AcceleratedCompositingContextEfl.h:
* WebCoreSupport/DumpRenderTreeSupportEfl.cpp:
(DumpRenderTreeSupportEfl::forcePaint): Repaint the entire webview before pixel dump.
* WebCoreSupport/DumpRenderTreeSupportEfl.h:
* ewk/ewk_view.cpp:
(ewk_view_mark_for_sync): Remove an unnecessary line.
(ewk_view_force_paint): Call flushAndRenderLayers().
(ewk_view_screenshot_contents_get): Remove 'scale' parameter and replace ewk_view_paint()
with AcceleratedCompositingContext::extractImageData().
* ewk/ewk_view.h:
* ewk/ewk_view_private.h:
* tests/test_ewk_view.cpp:
(TEST_F):

Tools:
* DumpRenderTree/efl/PixelDumpSupportEfl.cpp:
(createBitmapContextFromWebView): Add to call DumpRenderTreeSupportEfl::forcePaint().

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@167342 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Cocoa] Add a form delegate method corresponding to willSubmitForm
https://bugs.webkit.org/show_bug.cgi?id=131718

Reviewed by Tim Horton.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _setFormDelegate:]): Changed to define and create a FormClient (which derives
from API::FormClient and messages a delegate), and set it as the form client.

* UIProcess/API/Cocoa/_WKFormDelegate.h: Declared new delegate method.

* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFormDelegatePrivate.h: Added a
variant of willSubmitForm that returs a user object to pass to the delegate in the UI
process, giving it a temporary name with “new”.

* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
(-[WKWebProcessPlugInBrowserContextController _setFormDelegate:]): Changed willSubmitForm()
to check for the new bundle delegate method first and encode the user object as user data.
Moved the encoding of an NSObject <NSSecureCoding> as user data into a helper function.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@167343 268f45cc-cd09-0410-ab3c-d52691b4dbfc