[EFL] Add PageClientEfl to WebCoreSupport.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 22 Mar 2012 12:43:03 +0000 (12:43 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 22 Mar 2012 12:43:03 +0000 (12:43 +0000)
https://bugs.webkit.org/show_bug.cgi?id=80748

Patch by Hyowon Kim <hw1008.kim@samsung.com> on 2012-03-22
Reviewed by Noam Rosenthal.

Source/WebCore:

* platform/Widget.h: Use PageClientEfl as type for PlatformPageClient.
(WebCore):
* platform/graphics/efl/GraphicsContext3DPrivate.cpp:
(WebCore::GraphicsContext3DPrivate::createSurface): Change the argument type.
* plugins/efl/PluginViewEfl.cpp:
(WebCore::PluginView::platformGetValue): Use PageClientEfl.

Source/WebKit:

* PlatformEfl.cmake: Add WebCore/platform/graphics/efl to the include path
and PageClientEfl.cpp to the source list.

Source/WebKit/efl:

This patch adds PageClientEfl for implementaion of accelerated compositing.

* WebCoreSupport/ChromeClientEfl.cpp:
(WebCore::ChromeClientEfl::platformPageClient):
* WebCoreSupport/PageClientEfl.cpp: Added.
(WebCore):
(WebCore::PageClientEfl::PageClientEfl):
(WebCore::PageClientEfl::~PageClientEfl):
(WebCore::PageClientEfl::createEvasObjectForAcceleratedCompositing):
Just call ewk_view_accelerated_compositing_object_create().
(WebCore::PageClientEfl::acceleratedCompositingContext):
Just call ewk_view_accelerated_compositing_context_get().
* WebCoreSupport/PageClientEfl.h: Added.
(WebCore):
(PageClientEfl):
(WebCore::PageClientEfl::view): Return ewkView.
* ewk/ewk_private.h:
(WebCore):
(EWKPrivate):
* ewk/ewk_view.cpp:
(_Ewk_View_Private_Data): Add OwnPtr<PageClientEfl>.
(_ewk_view_priv_new): Create a new PageClientEfl.
(ewk_view_accelerated_compositing_object_create): Not implemented.
(ewk_view_accelerated_compositing_context_get): Not implemented.
(EWKPrivate::corePageClient): Return the PageClientEfl pointer.
(EWKPrivate):

Source/WTF:

* wtf/Platform.h: Disable accelerated compositing. It's not ready yet.

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

14 files changed:
Source/WTF/ChangeLog
Source/WTF/wtf/Platform.h
Source/WebCore/ChangeLog
Source/WebCore/platform/Widget.h
Source/WebCore/platform/graphics/efl/GraphicsContext3DPrivate.cpp
Source/WebCore/plugins/efl/PluginViewEfl.cpp
Source/WebKit/ChangeLog
Source/WebKit/PlatformEfl.cmake
Source/WebKit/efl/ChangeLog
Source/WebKit/efl/WebCoreSupport/ChromeClientEfl.cpp
Source/WebKit/efl/WebCoreSupport/PageClientEfl.cpp [new file with mode: 0644]
Source/WebKit/efl/WebCoreSupport/PageClientEfl.h [new file with mode: 0644]
Source/WebKit/efl/ewk/ewk_private.h
Source/WebKit/efl/ewk/ewk_view.cpp

index e07e04044d31c8a38add9f6c06c849bbe3e1505a..c77b5c6ab7443d9ad401531097c60f101ebd485b 100644 (file)
@@ -1,3 +1,12 @@
+2012-03-22  Hyowon Kim  <hw1008.kim@samsung.com>
+
+        [EFL] Add PageClientEfl to WebCoreSupport.
+        https://bugs.webkit.org/show_bug.cgi?id=80748
+
+        Reviewed by Noam Rosenthal.
+
+        * wtf/Platform.h: Disable accelerated compositing. It's not ready yet.
+
 2012-03-21  Beth Dakin  <bdakin@apple.com>
 
         https://bugs.webkit.org/show_bug.cgi?id=80322
index 50ebbcb321ff7b50bb3eaa6e47b38aa0e738e365..d5940a0e6b180ed1321f1736f33de624898bcd89 100644 (file)
 #endif
 
 /* Accelerated compositing */
-#if PLATFORM(MAC) || PLATFORM(IOS) || PLATFORM(QT) || (PLATFORM(WIN) && !OS(WINCE) && !PLATFORM(WIN_CAIRO)) || PLATFORM(EFL)
+#if PLATFORM(MAC) || PLATFORM(IOS) || PLATFORM(QT) || (PLATFORM(WIN) && !OS(WINCE) && !PLATFORM(WIN_CAIRO))
 #define WTF_USE_ACCELERATED_COMPOSITING 1
 #endif
 
index c4ff5c8231cb44a8df25f27987004e5e52b32cea..0daa38da5d61ec0b44f6961123c7bd72d91cb176 100644 (file)
@@ -1,3 +1,17 @@
+2012-03-22  Hyowon Kim  <hw1008.kim@samsung.com>
+
+        [EFL] Add PageClientEfl to WebCoreSupport.
+        https://bugs.webkit.org/show_bug.cgi?id=80748
+
+        Reviewed by Noam Rosenthal.
+
+        * platform/Widget.h: Use PageClientEfl as type for PlatformPageClient.
+        (WebCore):
+        * platform/graphics/efl/GraphicsContext3DPrivate.cpp:
+        (WebCore::GraphicsContext3DPrivate::createSurface): Change the argument type.
+        * plugins/efl/PluginViewEfl.cpp:
+        (WebCore::PluginView::platformGetValue): Use PageClientEfl.
+
 2012-03-22  Kaustubh Atrawalkar  <kaustubh@motorola.com>
 
         blur() on shadow host should work when a shadow host contains a focused element in its shadow DOM subtrees
index aeb33ecc97aa0a588bb66a44315f0e6174e1cc51..0d7cfd249d9082c287fe4f65a23af02ace5c69f8 100644 (file)
@@ -90,6 +90,11 @@ typedef QWebPageClient* PlatformPageClient;
 #elif PLATFORM(BLACKBERRY)
 #include "PageClientBlackBerry.h"
 typedef PageClientBlackBerry* PlatformPageClient;
+#elif PLATFORM(EFL)
+namespace WebCore {
+class PageClientEfl;
+typedef PageClientEfl* PlatformPageClient;
+}
 #else
 typedef PlatformWidget PlatformPageClient;
 #endif
index 08153f00444d89cb8e368edb3c7965b6323b1896..e51ddc1b4cf6ad348d3c675774ad7f82fa3c1feb 100644 (file)
@@ -139,7 +139,7 @@ bool GraphicsContext3DPrivate::createSurface(PageClientEfl* pageClient, bool ren
         evas_gl_native_surface_get(m_evasGL, m_surface, &nativeSurface);
 
         // Create and specially set up a evas_object which act as the render targer surface.
-        if (!pageClient->createEvasObjectForAcceleratedCompositing(&nativeSurface, x, y, width, height))
+        if (!pageClient->createEvasObjectForAcceleratedCompositing(&nativeSurface, IntRect(x, y, width, height)))
             return false;
     }
 #endif
index 586802c9335103969db335f2e2331bf609723bbc..86ea2009c428a9647e7453333c878bf393fb6b29 100644 (file)
@@ -38,6 +38,7 @@
 #include "HostWindow.h"
 #include "MouseEvent.h"
 #include "NotImplemented.h"
+#include "PageClientEfl.h"
 #include "PluginPackage.h"
 #include "npruntime_impl.h"
 #include "runtime/JSLock.h"
@@ -282,7 +283,8 @@ bool PluginView::platformGetValue(NPNVariable variable, void* value, NPError* re
     }
 
     case NPNVnetscapeWindow: {
-        Evas_Object* widget = m_parentFrame->view()->hostWindow()->platformPageClient();
+        PageClientEfl* pageClient = static_cast<PageClientEfl*>(m_parentFrame->view()->hostWindow()->platformPageClient());
+        Evas_Object* widget = pageClient->view();
         Evas* evas = evas_object_evas_get(widget);
         Ecore_Evas* ecoreEvas = ecore_evas_ecore_evas_get(evas);
         *static_cast<XID*>(value) = static_cast<Window>(ecore_evas_window_get(ecoreEvas));
index 85b85e7280c910c09d332771b688f27e42c1658b..61da4a3eadefbffd7cfeb52deca43b67f793a73c 100644 (file)
@@ -1,3 +1,13 @@
+2012-03-22  Hyowon Kim  <hw1008.kim@samsung.com>
+
+        [EFL] Add PageClientEfl to WebCoreSupport.
+        https://bugs.webkit.org/show_bug.cgi?id=80748
+
+        Reviewed by Noam Rosenthal.
+
+        * PlatformEfl.cmake: Add WebCore/platform/graphics/efl to the include path
+        and PageClientEfl.cpp to the source list.
+
 2012-03-20  Eric Seidel  <eric@webkit.org>
 
         Move wtf/Platform.h from JavaScriptCore to Source/WTF/wtf
index 158413553d9302dad17e824a594db6d7c3ac1f5c..10010c97126d9ebb1c0f71a68c4bfc51a7ff1d5e 100644 (file)
@@ -13,6 +13,7 @@ LIST(APPEND WebKit_INCLUDE_DIRECTORIES
     "${JAVASCRIPTCORE_DIR}/wtf/gobject"
     "${WEBCORE_DIR}/platform/efl"
     "${WEBCORE_DIR}/platform/graphics/cairo"
+    "${WEBCORE_DIR}/platform/graphics/efl"
     ${Cairo_INCLUDE_DIRS}
     ${ECORE_X_INCLUDE_DIRS}
     ${EDJE_INCLUDE_DIRS}
@@ -80,6 +81,7 @@ LIST(APPEND WebKit_SOURCES
     efl/WebCoreSupport/StorageTrackerClientEfl.cpp
     efl/WebCoreSupport/InspectorClientEfl.cpp
     efl/WebCoreSupport/NotificationPresenterClientEfl.cpp
+    efl/WebCoreSupport/PageClientEfl.cpp
 
     efl/ewk/ewk_auth.cpp
     efl/ewk/ewk_auth_soup.cpp
index 54037096fe399e330c587d4f4ed4fb4a3c98bfd8..123c7c1f4a97e53d0a20c5267024b63d03366093 100644 (file)
@@ -1,3 +1,37 @@
+2012-03-22  Hyowon Kim  <hw1008.kim@samsung.com>
+
+        [EFL] Add PageClientEfl to WebCoreSupport.
+        https://bugs.webkit.org/show_bug.cgi?id=80748
+
+        Reviewed by Noam Rosenthal.
+
+        This patch adds PageClientEfl for implementaion of accelerated compositing.
+
+        * WebCoreSupport/ChromeClientEfl.cpp:
+        (WebCore::ChromeClientEfl::platformPageClient):
+        * WebCoreSupport/PageClientEfl.cpp: Added.
+        (WebCore):
+        (WebCore::PageClientEfl::PageClientEfl):
+        (WebCore::PageClientEfl::~PageClientEfl):
+        (WebCore::PageClientEfl::createEvasObjectForAcceleratedCompositing):
+        Just call ewk_view_accelerated_compositing_object_create().
+        (WebCore::PageClientEfl::acceleratedCompositingContext):
+        Just call ewk_view_accelerated_compositing_context_get().
+        * WebCoreSupport/PageClientEfl.h: Added.
+        (WebCore):
+        (PageClientEfl):
+        (WebCore::PageClientEfl::view): Return ewkView.
+        * ewk/ewk_private.h:
+        (WebCore):
+        (EWKPrivate):
+        * ewk/ewk_view.cpp:
+        (_Ewk_View_Private_Data): Add OwnPtr<PageClientEfl>.
+        (_ewk_view_priv_new): Create a new PageClientEfl.
+        (ewk_view_accelerated_compositing_object_create): Not implemented.
+        (ewk_view_accelerated_compositing_context_get): Not implemented.
+        (EWKPrivate::corePageClient): Return the PageClientEfl pointer.
+        (EWKPrivate):
+
 2012-03-19  Adam Barth  <abarth@webkit.org>
 
         Remove support for "magic" iframe
index dd79b93a1a45f09d668b974d720c0585d734b879..68adf5fc1698fae340595ec6a65f58fd65e02b79 100644 (file)
@@ -339,7 +339,7 @@ IntPoint ChromeClientEfl::screenToRootView(const IntPoint& point) const
 
 PlatformPageClient ChromeClientEfl::platformPageClient() const
 {
-    return m_view;
+    return EWKPrivate::corePageClient(m_view);
 }
 
 void ChromeClientEfl::scrollbarsModeDidChange() const
diff --git a/Source/WebKit/efl/WebCoreSupport/PageClientEfl.cpp b/Source/WebKit/efl/WebCoreSupport/PageClientEfl.cpp
new file mode 100644 (file)
index 0000000..5e65ede
--- /dev/null
@@ -0,0 +1,49 @@
+/*
+    Copyright (C) 2012 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.1 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 "PageClientEfl.h"
+
+#include "ewk_private.h"
+
+namespace WebCore {
+
+PageClientEfl::PageClientEfl(Evas_Object* view)
+    : m_view(view)
+{
+    ASSERT(m_view);
+}
+
+PageClientEfl::~PageClientEfl()
+{
+}
+
+#if USE(ACCELERATED_COMPOSITING)
+bool PageClientEfl::createEvasObjectForAcceleratedCompositing(Evas_Native_Surface* nativeSurface, const IntRect& rect)
+{
+    return ewk_view_accelerated_compositing_object_create(m_view, nativeSurface, rect);
+}
+
+GraphicsContext3D* PageClientEfl::acceleratedCompositingContext()
+{
+    return ewk_view_accelerated_compositing_context_get(m_view);
+}
+#endif
+
+}
diff --git a/Source/WebKit/efl/WebCoreSupport/PageClientEfl.h b/Source/WebKit/efl/WebCoreSupport/PageClientEfl.h
new file mode 100644 (file)
index 0000000..f541303
--- /dev/null
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2012 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.1 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.
+ */
+
+#ifndef PageClientEfl_h
+#define PageClientEfl_h
+
+#include "IntRect.h"
+
+typedef struct _Evas_Native_Surface Evas_Native_Surface;
+typedef struct _Evas_Object Evas_Object;
+
+namespace WebCore {
+
+class GraphicsContext3D;
+
+class PageClientEfl {
+public:
+    PageClientEfl(Evas_Object* view);
+    virtual ~PageClientEfl();
+
+#if USE(ACCELERATED_COMPOSITING)
+    bool createEvasObjectForAcceleratedCompositing(Evas_Native_Surface*, const IntRect&);
+    GraphicsContext3D* acceleratedCompositingContext();
+#endif
+
+    Evas_Object* view() { return m_view; }
+
+protected:
+    Evas_Object* m_view;
+};
+
+} // namespace WebCore
+
+#endif // PageClientEfl_h
index b4a8dd936103b80f209ab9b1a0af5d2dd1d58026..96e4795baee9d10a361d33c1b80f4580bcf63123 100644 (file)
@@ -36,6 +36,9 @@
 #include "ewk_js.h"
 #include "ewk_view.h"
 #include <Evas.h>
+#if USE(ACCELERATED_COMPOSITING)
+#include <Evas_GL.h>
+#endif
 #include <wtf/PassRefPtr.h>
 #include <wtf/Vector.h>
 
@@ -74,6 +77,10 @@ namespace WebCore {
 struct PopupMenuClient;
 struct ContextMenu;
 struct ContextMenuItem;
+#if USE(ACCELERATED_COMPOSITING)
+class GraphicsContext3D;
+class GraphicsLayer;
+#endif
 }
 
 struct Ewk_Window_Object_Cleared_Event {
@@ -87,6 +94,7 @@ namespace EWKPrivate {
 WebCore::Frame *coreFrame(const Evas_Object *ewkFrame);
 WebCore::Page *corePage(const Evas_Object *ewkView);
 WebCore::HistoryItem *coreHistoryItem(const Ewk_History_Item *ewkHistoryItem);
+WebCore::PlatformPageClient corePageClient(Evas_Object* ewkView);
 
 Evas_Object* kitFrame(const WebCore::Frame* coreFrame);
 
@@ -234,4 +242,9 @@ void ewk_frame_mixed_content_run_set(Evas_Object* ewkFrame, bool hasRun);
 void ewk_view_mixed_content_displayed_set(Evas_Object* ewkView, bool hasDisplayed);
 void ewk_view_mixed_content_run_set(Evas_Object* ewkView, bool hasRun);
 
+#if USE(ACCELERATED_COMPOSITING)
+bool ewk_view_accelerated_compositing_object_create(Evas_Object* ewkView, Evas_Native_Surface* nativeSurface, const WebCore::IntRect& rect);
+WebCore::GraphicsContext3D* ewk_view_accelerated_compositing_context_get(Evas_Object* ewkView);
+#endif
+
 #endif // ewk_private_h
index 7a52caf1c22311a111c4b5f30e0f477d0c2e457c..ce0bd896b05f42660ef7dc58d7b9e64ef3a9765a 100644 (file)
@@ -45,6 +45,7 @@
 #include "JSDOMWindow.h"
 #include "JSLock.h"
 #include "LayoutTypes.h"
+#include "PageClientEfl.h"
 #include "PlatformMouseEvent.h"
 #include "PopupMenuClient.h"
 #include "ProgressTracker.h"
 #include "BatteryClientEfl.h"
 #endif
 
+#if USE(ACCELERATED_COMPOSITING)
+#include "NotImplemented.h"
+#endif
+
 static const float zoomMinimum = 0.05;
 static const float zoomMaximum = 4.0;
 
@@ -142,6 +147,7 @@ struct _Ewk_View_Private_Data {
     WebCore::Frame* mainFrame;
     WebCore::ViewportArguments viewportArguments;
     Ewk_History* history;
+    OwnPtr<WebCore::PageClientEfl> pageClient;
     struct {
         Ewk_Menu menu;
         WebCore::PopupMenuClient* menuClient;
@@ -716,6 +722,8 @@ static Ewk_View_Private_Data* _ewk_view_priv_new(Ewk_View_Smart_Data* smartData)
 
     priv->soupSession = WebCore::ResourceHandle::defaultSession();
 
+    priv->pageClient = adoptPtr(new WebCore::PageClientEfl(smartData->self));
+
     return priv;
 }
 
@@ -3924,6 +3932,20 @@ void ewk_view_soup_session_set(Evas_Object* ewkView, SoupSession* session)
     priv->soupSession = session;
 }
 
+#if USE(ACCELERATED_COMPOSITING)
+bool ewk_view_accelerated_compositing_object_create(Evas_Object* ewkView, Evas_Native_Surface* nativeSurface, const WebCore::IntRect& rect)
+{
+    notImplemented();
+    return false;
+}
+
+WebCore::GraphicsContext3D* ewk_view_accelerated_compositing_context_get(Evas_Object* ewkView)
+{
+    notImplemented();
+    return 0;
+}
+#endif
+
 namespace EWKPrivate {
 
 WebCore::Page *corePage(const Evas_Object *ewkView)
@@ -3933,4 +3955,11 @@ WebCore::Page *corePage(const Evas_Object *ewkView)
     return priv->page.get();
 }
 
+WebCore::PlatformPageClient corePageClient(Evas_Object* ewkView)
+{
+    EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData, 0);
+    EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv, 0);
+    return priv->pageClient.get();
+}
+
 } // namespace EWKPrivate