| Differences between
and this patch
- Tools/ChangeLog +22 lines
Lines 1-3 Tools/ChangeLog_sec1
1
2011-06-02  Leandro Pereira  <leandro@profusion.mobi>
2
3
        Reviewed by NOBODY (OOPS!).
4
5
        [EFL] DumpRenderTree: Add GCController, PixelDumpsupport and WorkQueueItem.
6
        https://bugs.webkit.org/show_bug.cgi?id=61958
7
8
        * DumpRenderTree/efl: Added.
9
        * DumpRenderTree/efl/GCControllerEfl.cpp: Added.
10
        (GCController::collect):
11
        (GCController::collectOnAlternateThread):
12
        (GCController::getJSObjectCount):
13
        * DumpRenderTree/efl/PixelDumpSupportEfl.cpp: Added.
14
        (createBitmapContextFromWebView):
15
        * DumpRenderTree/efl/WorkQueueItemEfl.cpp: Added.
16
        (JSStringCopyUTF8CString): Copied from the GTK+ DRT.
17
        (LoadItem::invoke):
18
        (LoadHTMLStringItem::invoke):
19
        (ReloadItem::invoke):
20
        (ScriptItem::invoke):
21
        (BackForwardItem::invoke):
22
1
2011-06-02  Dimitri Glazkov  <dglazkov@chromium.org>
23
2011-06-02  Dimitri Glazkov  <dglazkov@chromium.org>
2
24
3
        Reviewed by Darin Adler.
25
        Reviewed by Darin Adler.
- Tools/DumpRenderTree/efl/GCControllerEfl.cpp +49 lines
Line 0 Tools/DumpRenderTree/efl/GCControllerEfl.cpp_sec1
1
/*
2
 * Copyright (C) 2007 Eric Seidel <eric@webkit.org>
3
 * Copyright (C) 2011 ProFUSION Embedded Systems
4
 * Copyright (C) 2011 Samsung Electronics
5
 *
6
 * Redistribution and use in source and binary forms, with or without
7
 * modification, are permitted provided that the following conditions
8
 * are met:
9
 *
10
 * 1.  Redistributions of source code must retain the above copyright
11
 *     notice, this list of conditions and the following disclaimer.
12
 * 2.  Redistributions in binary form must reproduce the above copyright
13
 *     notice, this list of conditions and the following disclaimer in the
14
 *     documentation and/or other materials provided with the distribution.
15
 * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
16
 *     its contributors may be used to endorse or promote products derived
17
 *     from this software without specific prior written permission.
18
 *
19
 * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
20
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
21
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22
 * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
23
 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
24
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
25
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
26
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
28
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29
 */
30
31
#include "config.h"
32
#include "GCController.h"
33
34
#include "ewk_private.h"
35
36
void GCController::collect() const
37
{
38
    ewk_util_javascript_gc_collect();
39
}
40
41
void GCController::collectOnAlternateThread(bool waitUntilDone) const
42
{
43
    ewk_util_javascript_gc_alternate_thread_collect(waitUntilDone);
44
}
45
46
size_t GCController::getJSObjectCount() const
47
{
48
    return ewk_util_javascript_gc_object_count_get();
49
}
- Tools/DumpRenderTree/efl/PixelDumpSupportEfl.cpp +74 lines
Line 0 Tools/DumpRenderTree/efl/PixelDumpSupportEfl.cpp_sec1
1
/*
2
 * Copyright (C) 2009 Zan Dobersek <zandobersek@gmail.com>
3
 * Copyright (C) 2010 Igalia S.L.
4
 * Copyright (C) 2011 ProFUSION Embedded Systems
5
 * Copyright (C) 2011 Samsung Electronics
6
 *
7
 * Redistribution and use in source and binary forms, with or without
8
 * modification, are permitted provided that the following conditions
9
 * are met:
10
 *
11
 * 1.  Redistributions of source code must retain the above copyright
12
 *     notice, this list of conditions and the following disclaimer.
13
 * 2.  Redistributions in binary form must reproduce the above copyright
14
 *     notice, this list of conditions and the following disclaimer in the
15
 *     documentation and/or other materials provided with the distribution.
16
 * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
17
 *     its contributors may be used to endorse or promote products derived
18
 *     from this software without specific prior written permission.
19
 *
20
 * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
21
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
22
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23
 * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
24
 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
25
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
26
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
27
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
29
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30
 */
31
32
#include "config.h"
33
#include "PixelDumpSupportCairo.h"
34
35
#include "DumpRenderTree.h"
36
#include "ewk_private.h"
37
38
PassRefPtr<BitmapContext> createBitmapContextFromWebView(bool, bool, bool, bool drawSelectionRect)
39
{
40
    cairo_surface_t* surface;
41
    cairo_t* context;
42
    int width, height;
43
    Ewk_View_Smart_Data* smartData;
44
    Ewk_View_Private_Data* privateData;
45
46
    if (!ewk_frame_contents_size_get(mainFrame, &width, &height))
47
        return 0;
48
49
    surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, width, height);
50
    context = cairo_create(surface);
51
52
    Eina_Rectangle rect = { 0, 0, width, height };
53
    smartData = static_cast<Ewk_View_Smart_Data*>(evas_object_smart_data_get(browser));
54
    privateData = static_cast<Ewk_View_Private_Data*>(smartData->_priv);
55
56
    if (!ewk_view_paint_contents(privateData, context, &rect)) {
57
        cairo_destroy(context);
58
        cairo_surface_destroy(surface);
59
        return 0;
60
    }
61
62
    if (drawSelectionRect) {
63
        int x, y, rectWidth, rectHeight;
64
65
        if (ewk_frame_selection_rectangle_get(mainFrame, &x, &y, &rectWidth, &rectHeight)) {
66
            cairo_set_line_width(context, 1.0);
67
            cairo_rectangle(context, x, y, rectWidth, rectHeight);
68
            cairo_set_source_rgba(context, 1.0, 0.0, 0.0, 1.0);
69
            cairo_stroke(context);
70
        }
71
    }
72
73
    return BitmapContext::createByAdoptingBitmapAndContext(0, context);
74
}
- Tools/DumpRenderTree/efl/WorkQueueItemEfl.cpp +104 lines
Line 0 Tools/DumpRenderTree/efl/WorkQueueItemEfl.cpp_sec1
1
/*
2
 * Copyright (C) 2007 Alp Toker <alp@atoker.com>
3
 * Copyright (C) 2011 ProFUSION Embedded Systems
4
 * Copyright (C) 2011 Samsung Electronics
5
 *
6
 * This library is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU Library General Public
8
 * License as published by the Free Software Foundation; either
9
 * version 2 of the License, or (at your option) any later version.
10
 *
11
 * This library is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14
 * Library General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU Library General Public License
17
 * along with this library; see the file COPYING.LIB.  If not, write to
18
 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19
 * Boston, MA 02110-1301, USA.
20
 */
21
22
#include "config.h"
23
#include "WorkQueueItem.h"
24
25
#include "DumpRenderTree.h"
26
#include <EWebKit.h>
27
#include <JavaScriptCore/JSStringRef.h>
28
29
char* JSStringCopyUTF8CString(JSStringRef jsString)
30
{
31
    size_t dataSize = JSStringGetMaximumUTF8CStringSize(jsString);
32
    char* utf8 = static_cast<char*>(malloc(dataSize));
33
    JSStringGetUTF8CString(jsString, utf8, dataSize);
34
35
    return utf8;
36
}
37
38
bool LoadItem::invoke() const
39
{
40
    char* targetString = JSStringCopyUTF8CString(m_target.get());
41
    Evas_Object* targetFrame;
42
43
    if (!strlen(targetString))
44
        targetFrame = mainFrame;
45
    else
46
        targetFrame = ewk_frame_child_find(mainFrame, targetString);
47
    free(targetString);
48
49
    char* urlString = JSStringCopyUTF8CString(m_url.get());
50
    ewk_frame_uri_set(targetFrame, urlString);
51
    free(urlString);
52
53
    return true;
54
}
55
56
bool LoadHTMLStringItem::invoke() const
57
{
58
    char* content = JSStringCopyUTF8CString(m_content.get());
59
    char* baseURL = JSStringCopyUTF8CString(m_baseURL.get());
60
61
    if (m_unreachableURL) {
62
        char* unreachableURL = JSStringCopyUTF8CString(m_unreachableURL.get());
63
        ewk_frame_contents_alternate_set(mainFrame, content, 0, 0, 0, baseURL, unreachableURL);
64
        free(unreachableURL);
65
    } else
66
        ewk_frame_contents_set(mainFrame, content, 0, 0, 0, baseURL);
67
68
    free(content);
69
    free(baseURL);
70
71
    return true;
72
}
73
74
bool ReloadItem::invoke() const
75
{
76
    ewk_view_reload(browser);
77
    return true;
78
}
79
80
bool ScriptItem::invoke() const
81
{
82
    char* scriptString = JSStringCopyUTF8CString(m_script.get());
83
    bool returnValue = ewk_frame_script_execute(mainFrame, scriptString);
84
    free(scriptString);
85
    return returnValue;
86
}
87
88
bool BackForwardItem::invoke() const
89
{
90
    Ewk_History* history;
91
92
    history = ewk_view_history_get(browser);
93
    if (m_howFar == 1)
94
        ewk_history_forward(history);
95
    else if (m_howFar == -1)
96
        ewk_history_back(history);
97
    else {
98
        Ewk_History_Item* item;
99
100
        item = ewk_history_history_item_nth_get(history, m_howFar);
101
        ewk_history_history_item_set(history, item);
102
    }
103
    return true;
104
}

Return to Bug 61958