Title: [89053] trunk/Tools
Revision
89053
Author
[email protected]
Date
2011-06-16 11:41:09 -0700 (Thu, 16 Jun 2011)

Log Message

2011-06-16  Leandro Pereira  <[email protected]>

        Reviewed by Eric Seidel.

        [EFL] DumpRenderTree: Add GCController, PixelDumpSupport and
        WorkQueueItem.
        They will be plugged into the build system once the EFL's DRT is
        fully upstreamed.
        https://bugs.webkit.org/show_bug.cgi?id=61958

        * DumpRenderTree/efl: Added.
        * DumpRenderTree/efl/GCControllerEfl.cpp: Added.
        (GCController::collect):
        (GCController::collectOnAlternateThread):
        (GCController::getJSObjectCount):
        * DumpRenderTree/efl/PixelDumpSupportEfl.cpp: Added.
        (createBitmapContextFromWebView):
        * DumpRenderTree/efl/WorkQueueItemEfl.cpp: Added.
        (LoadItem::invoke):
        (LoadHTMLStringItem::invoke):
        (ReloadItem::invoke):
        (ScriptItem::invoke):
        (BackForwardItem::invoke):
        * DumpRenderTree/efl/WorkQueueItemEfl.h: Added.
        (WorkQueueItem::~WorkQueueItem):
        (LoadItem::LoadItem):
        (LoadHTMLStringItem::LoadHTMLStringItem):
        (ScriptItem::ScriptItem):
        (LoadingScriptItem::LoadingScriptItem):
        (LoadingScriptItem::invoke):
        (NonLoadingScriptItem::NonLoadingScriptItem):
        (NonLoadingScriptItem::invoke):
        (BackForwardItem::BackForwardItem):
        (BackItem::BackItem):
        (ForwardItem::ForwardItem):

Modified Paths

Added Paths

Diff

Modified: trunk/Tools/ChangeLog (89052 => 89053)


--- trunk/Tools/ChangeLog	2011-06-16 18:39:48 UTC (rev 89052)
+++ trunk/Tools/ChangeLog	2011-06-16 18:41:09 UTC (rev 89053)
@@ -1,3 +1,39 @@
+2011-06-16  Leandro Pereira  <[email protected]>
+
+        Reviewed by Eric Seidel.
+
+        [EFL] DumpRenderTree: Add GCController, PixelDumpSupport and
+        WorkQueueItem.
+        They will be plugged into the build system once the EFL's DRT is
+        fully upstreamed.
+        https://bugs.webkit.org/show_bug.cgi?id=61958
+
+        * DumpRenderTree/efl: Added.
+        * DumpRenderTree/efl/GCControllerEfl.cpp: Added.
+        (GCController::collect):
+        (GCController::collectOnAlternateThread):
+        (GCController::getJSObjectCount):
+        * DumpRenderTree/efl/PixelDumpSupportEfl.cpp: Added.
+        (createBitmapContextFromWebView):
+        * DumpRenderTree/efl/WorkQueueItemEfl.cpp: Added.
+        (LoadItem::invoke):
+        (LoadHTMLStringItem::invoke):
+        (ReloadItem::invoke):
+        (ScriptItem::invoke):
+        (BackForwardItem::invoke):
+        * DumpRenderTree/efl/WorkQueueItemEfl.h: Added.
+        (WorkQueueItem::~WorkQueueItem):
+        (LoadItem::LoadItem):
+        (LoadHTMLStringItem::LoadHTMLStringItem):
+        (ScriptItem::ScriptItem):
+        (LoadingScriptItem::LoadingScriptItem):
+        (LoadingScriptItem::invoke):
+        (NonLoadingScriptItem::NonLoadingScriptItem):
+        (NonLoadingScriptItem::invoke):
+        (BackForwardItem::BackForwardItem):
+        (BackItem::BackItem):
+        (ForwardItem::ForwardItem):
+
 2011-06-16  Kevin Ollivier  <[email protected]>
 
         [wx] Unreviewed build fix, make sure the waf build checks the webKitBranchBuild

Added: trunk/Tools/DumpRenderTree/efl/GCControllerEfl.cpp (0 => 89053)


--- trunk/Tools/DumpRenderTree/efl/GCControllerEfl.cpp	                        (rev 0)
+++ trunk/Tools/DumpRenderTree/efl/GCControllerEfl.cpp	2011-06-16 18:41:09 UTC (rev 89053)
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2011 ProFUSION Embedded Systems
+ * Copyright (C) 2011 Samsung Electronics
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ *     its contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "GCController.h"
+
+#include "ewk_private.h"
+
+void GCController::collect() const
+{
+    ewk_util_javascript_gc_collect();
+}
+
+void GCController::collectOnAlternateThread(bool waitUntilDone) const
+{
+    ewk_util_javascript_gc_alternate_thread_collect(waitUntilDone);
+}
+
+size_t GCController::getJSObjectCount() const
+{
+    return ewk_util_javascript_gc_object_count_get();
+}

Added: trunk/Tools/DumpRenderTree/efl/PixelDumpSupportEfl.cpp (0 => 89053)


--- trunk/Tools/DumpRenderTree/efl/PixelDumpSupportEfl.cpp	                        (rev 0)
+++ trunk/Tools/DumpRenderTree/efl/PixelDumpSupportEfl.cpp	2011-06-16 18:41:09 UTC (rev 89053)
@@ -0,0 +1,67 @@
+/*
+ * Copyright (C) 2009 Zan Dobersek <[email protected]>
+ * Copyright (C) 2010 Igalia S.L.
+ * Copyright (C) 2011 ProFUSION Embedded Systems
+ * Copyright (C) 2011 Samsung Electronics
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ *     its contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#include "DumpRenderTree.h"
+#include "PixelDumpSupportCairo.h"
+#include "RefPtrCairo.h"
+#include "ewk_private.h"
+
+PassRefPtr<BitmapContext> createBitmapContextFromWebView(bool, bool, bool, bool drawSelectionRect)
+{
+    Ewk_View_Smart_Data* smartData = static_cast<Ewk_View_Smart_Data*>(evas_object_smart_data_get(browser));
+    Ewk_View_Private_Data* privateData = static_cast<Ewk_View_Private_Data*>(smartData->_priv);
+
+    int width, height;
+    if (!ewk_frame_contents_size_get(mainFrame, &width, &height))
+        return 0;
+
+    RefPtr<cairo_surface_t> surface = adoptRef(cairo_image_surface_create(CAIRO_FORMAT_ARGB32, width, height));
+    RefPtr<cairo_t> context = adoptRef(cairo_create(surface.get()));
+
+    const Eina_Rectangle rect = { 0, 0, width, height };
+    if (!ewk_view_paint_contents(privateData, context.get(), &rect))
+        return 0;
+
+    if (drawSelectionRect) {
+        int x, y, rectWidth, rectHeight;
+
+        if (ewk_frame_selection_rectangle_get(mainFrame, &x, &y, &rectWidth, &rectHeight)) {
+            cairo_set_line_width(context.get(), 1.0);
+            cairo_rectangle(context.get(), x, y, rectWidth, rectHeight);
+            cairo_set_source_rgba(context.get(), 1.0, 0.0, 0.0, 1.0);
+            cairo_stroke(context.get());
+        }
+    }
+
+    return BitmapContext::createByAdoptingBitmapAndContext(0, context.get());
+}

Added: trunk/Tools/DumpRenderTree/efl/WorkQueueItemEfl.cpp (0 => 89053)


--- trunk/Tools/DumpRenderTree/efl/WorkQueueItemEfl.cpp	                        (rev 0)
+++ trunk/Tools/DumpRenderTree/efl/WorkQueueItemEfl.cpp	2011-06-16 18:41:09 UTC (rev 89053)
@@ -0,0 +1,80 @@
+/*
+ * Copyright (C) 2007 Alp Toker <[email protected]>
+ * Copyright (C) 2011 ProFUSION Embedded Systems
+ * Copyright (C) 2011 Samsung Electronics
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "config.h"
+#include "WorkQueueItemEfl.h"
+
+#include "DumpRenderTree.h"
+
+#include <EWebKit.h>
+#include <_javascript_Core/JSStringRef.h>
+#include <_javascript_Core/wtf/text/CString.h>
+
+bool LoadItem::invoke() const
+{
+    Evas_Object* targetFrame;
+
+    if (m_target.isEmpty())
+        targetFrame = mainFrame;
+    else
+        targetFrame = ewk_frame_child_find(mainFrame, m_target.utf8().data());
+
+    ewk_frame_uri_set(targetFrame, m_url.utf8().data());
+
+    return true;
+}
+
+bool LoadHTMLStringItem::invoke() const
+{
+    if (m_unreachableURL.isEmpty())
+        ewk_frame_contents_set(mainFrame, m_content.utf8().data(), 0, 0, 0, m_baseURL.utf8().data());
+    else
+        ewk_frame_contents_alternate_set(mainFrame, m_content.utf8().data(), 0, 0, 0, m_baseURL.utf8().data(), m_unreachableURL.utf8().data());
+
+    return true;
+}
+
+bool ReloadItem::invoke() const
+{
+    ewk_view_reload(browser);
+    return true;
+}
+
+bool ScriptItem::invoke() const
+{
+    return ewk_frame_script_execute(mainFrame, m_script.utf8().data());
+}
+
+bool BackForwardItem::invoke() const
+{
+    Ewk_History* history = ewk_view_history_get(browser);
+
+    if (m_howFar == 1)
+        ewk_history_forward(history);
+    else if (m_howFar == -1)
+        ewk_history_back(history);
+    else {
+        const Ewk_History_Item* item = ewk_history_history_item_nth_get(history, m_howFar);
+        ewk_history_history_item_set(history, item);
+    }
+
+    return true;
+}

Added: trunk/Tools/DumpRenderTree/efl/WorkQueueItemEfl.h (0 => 89053)


--- trunk/Tools/DumpRenderTree/efl/WorkQueueItemEfl.h	                        (rev 0)
+++ trunk/Tools/DumpRenderTree/efl/WorkQueueItemEfl.h	2011-06-16 18:41:09 UTC (rev 89053)
@@ -0,0 +1,140 @@
+/*
+ * Copyright (C) 2011 ProFUSION Embedded Systems
+ * Copyright (C) 2011 Samsung Electronics
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WorkQueueItemEfl_h
+#define WorkQueueItemEfl_h
+
+#include <_javascript_Core/wtf/text/WTFString.h>
+
+class WorkQueueItem {
+public:
+    virtual ~WorkQueueItem() { }
+    virtual bool invoke() const = 0; // Returns true if this started a load.
+};
+
+class LoadItem : public WorkQueueItem {
+public:
+    LoadItem(const WTF::String& url, const WTF::String& target)
+        : m_target(target)
+        , m_url(url)
+    {
+    }
+
+    virtual bool invoke() const;
+
+private:
+    WTF::String m_target;
+    WTF::String m_url;
+};
+
+class LoadHTMLStringItem : public WorkQueueItem {
+public:
+    LoadHTMLStringItem(const WTF::String& content, const WTF::String& baseURL, const WTF::String& unreachableURL = WTF::String())
+        : m_content(content)
+        , m_baseURL(baseURL)
+        , m_unreachableURL(unreachableURL)
+    {
+    }
+
+private:
+    virtual bool invoke() const;
+
+    WTF::String m_content;
+    WTF::String m_baseURL;
+    WTF::String m_unreachableURL;
+};
+
+class ReloadItem : public WorkQueueItem {
+private:
+    virtual bool invoke() const;
+};
+
+class ScriptItem : public WorkQueueItem {
+protected:
+    ScriptItem(const WTF::String& script)
+        : m_script(script)
+    {
+    }
+
+protected:
+    virtual bool invoke() const;
+
+private:
+    WTF::String m_script;
+};
+
+class LoadingScriptItem : public ScriptItem {
+public:
+    LoadingScriptItem(const WTF::String& script)
+        : ScriptItem(script)
+    {
+    }
+
+private:
+    virtual bool invoke() const { return ScriptItem::invoke(); }
+};
+
+class NonLoadingScriptItem : public ScriptItem {
+public:
+    NonLoadingScriptItem(const WTF::String& script)
+        : ScriptItem(script)
+    {
+    }
+
+private:
+    virtual bool invoke() const { ScriptItem::invoke(); return false; }
+};
+
+class BackForwardItem : public WorkQueueItem {
+protected:
+    BackForwardItem(int howFar)
+        : m_howFar(howFar)
+    {
+    }
+
+private:
+    virtual bool invoke() const;
+
+    int m_howFar;
+};
+
+class BackItem : public BackForwardItem {
+public:
+    BackItem(unsigned howFar)
+        : BackForwardItem(-howFar)
+    {
+    }
+};
+
+class ForwardItem : public BackForwardItem {
+public:
+    ForwardItem(unsigned howFar)
+        : BackForwardItem(howFar)
+    {
+    }
+};
+
+#endif // WorkQueueEfl_h
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to