Changeset 116461 in webkit


Ignore:
Timestamp:
May 8, 2012 3:50:11 PM (12 years ago)
Author:
ryuan.choi@samsung.com
Message:

[EFL][DRT] WebKit/DRT should not paint webview for the pixel tests.
https://bugs.webkit.org/show_bug.cgi?id=79853

Reviewed by Eric Seidel.

Screen buffer can be different from rendered results.
For example, WebKit/Efl just moves tiles for ewk_view_tiled when scrolling
contents.
It means that pixel tests can't check regression of ewk_view_tiled.

This patch changes a way to provide bitmap from painting webview to capturing
evas.

  • DumpRenderTree/efl/PixelDumpSupportEfl.cpp:

(createBitmapContextFromWebView):

Location:
trunk/Tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r116434 r116461  
     12012-05-08  Ryuan Choi  <ryuan.choi@samsung.com>
     2
     3        [EFL][DRT] WebKit/DRT should not paint webview for the pixel tests.
     4        https://bugs.webkit.org/show_bug.cgi?id=79853
     5
     6        Reviewed by Eric Seidel.
     7
     8        Screen buffer can be different from rendered results.
     9        For example, WebKit/Efl just moves tiles for ewk_view_tiled when scrolling
     10        contents.
     11        It means that pixel tests can't check regression of ewk_view_tiled.
     12
     13        This patch changes a way to provide bitmap from painting webview to capturing
     14        evas.
     15
     16        * DumpRenderTree/efl/PixelDumpSupportEfl.cpp:
     17        (createBitmapContextFromWebView):
     18
    1192012-05-08  Sudarsana Nagineni  <sudarsana.nagineni@linux.intel.com>
    220
  • trunk/Tools/DumpRenderTree/efl/PixelDumpSupportEfl.cpp

    r97464 r116461  
    3838#include "RefPtrCairo.h"
    3939#include "WebCoreSupport/DumpRenderTreeSupportEfl.h"
    40 #include "ewk_private.h"
     40#include <Ecore_Evas.h>
     41#include <Evas.h>
    4142
    4243PassRefPtr<BitmapContext> createBitmapContextFromWebView(bool, bool, bool, bool drawSelectionRect)
    4344{
    44     Ewk_View_Smart_Data* smartData = static_cast<Ewk_View_Smart_Data*>(evas_object_smart_data_get(browser->mainView()));
    45     Ewk_View_Private_Data* privateData = static_cast<Ewk_View_Private_Data*>(smartData->_priv);
    46     const Evas_Object* mainFrame = browser->mainFrame();
     45    const Evas_Object* mainView = browser->mainView();
     46    Evas* evas = evas_object_evas_get(mainView);
     47    Ecore_Evas* ecoreEvas = ecore_evas_ecore_evas_get(evas);
    4748
    48     int x, y, width, height;
    49     if (!ewk_frame_visible_content_geometry_get(mainFrame, EINA_TRUE, &x, &y, &width, &height))
    50         return 0;
     49    int width, height;
     50    evas_object_geometry_get(mainView, 0, 0, &width, &height);
    5151
    52     RefPtr<cairo_surface_t> surface = adoptRef(cairo_image_surface_create(CAIRO_FORMAT_ARGB32, width, height));
    53     RefPtr<cairo_t> context = adoptRef(cairo_create(surface.get()));
     52    const void* pixels = ecore_evas_buffer_pixels_get(ecoreEvas);
     53    RefPtr<cairo_surface_t> viewSurface = adoptRef(cairo_image_surface_create_for_data(static_cast<unsigned char*>(const_cast<void*>(pixels)), CAIRO_FORMAT_ARGB32, width, height, width * 4));
    5454
    55     const Eina_Rectangle rect = { x, y, width, height };
    56     if (!ewk_view_paint(privateData, context.get(), &rect))
    57         return 0;
     55    RefPtr<cairo_surface_t> imageSurface = adoptRef(cairo_image_surface_create(CAIRO_FORMAT_ARGB32, width, height));
     56    RefPtr<cairo_t> context = adoptRef(cairo_create(imageSurface.get()));
     57
     58    cairo_set_source_surface(context.get(), viewSurface.get(), 0, 0);
     59    cairo_paint(context.get());
    5860
    5961    if (drawSelectionRect) {
     62        const Evas_Object* mainFrame = browser->mainFrame();
    6063        const WebCore::IntRect selectionRect = DumpRenderTreeSupportEfl::selectionRectangle(mainFrame);
    6164
Note: See TracChangeset for help on using the changeset viewer.