Title: [131896] trunk/Source/WebKit2
Revision
131896
Author
[email protected]
Date
2012-10-19 06:58:03 -0700 (Fri, 19 Oct 2012)

Log Message

[EFL][WK2] Rename EflViewportHandler to PageViewportControllerClientEfl
https://bugs.webkit.org/show_bug.cgi?id=99101

Patch by Yael Aharon <[email protected]> on 2012-10-19
Reviewed by Gyuyoung Kim.

Rename EFlViewportHandler to PageViewportControllerClientEfl.
Also, make it inherit from PageViewportControllerClient. The actual implementation
of PageViewportControllerClient for Efl port will come in a separate patch.

* CMakeLists.txt:
* PlatformEfl.cmake:
* UIProcess/API/efl/EflViewportHandler.cpp: Removed.
* UIProcess/API/efl/EflViewportHandler.h: Removed.
* UIProcess/API/efl/PageViewportControllerClientEfl.cpp: Copied from Source/WebKit2/UIProcess/API/efl/EflViewportHandler.cpp.
(WebKit::PageViewportControllerClientEfl::PageViewportControllerClientEfl):
(WebKit::PageViewportControllerClientEfl::~PageViewportControllerClientEfl):
(WebKit::PageViewportControllerClientEfl::drawingArea):
(WebKit::PageViewportControllerClientEfl::setRendererActive):
(WebKit::PageViewportControllerClientEfl::display):
(WebKit::PageViewportControllerClientEfl::updateViewportSize):
(WebKit::PageViewportControllerClientEfl::setVisibleContentsRect):
(WebKit::PageViewportControllerClientEfl::didChangeContentsSize):
(WebKit):
(WebKit::PageViewportControllerClientEfl::setViewportPosition):
(WebKit::PageViewportControllerClientEfl::setContentsScale):
(WebKit::PageViewportControllerClientEfl::didResumeContent):
(WebKit::PageViewportControllerClientEfl::didChangeVisibleContents):
(WebKit::PageViewportControllerClientEfl::didChangeViewportAttributes):
(WebKit::PageViewportControllerClientEfl::setController):
* UIProcess/API/efl/PageViewportControllerClientEfl.h: Copied from Source/WebKit2/UIProcess/API/efl/EflViewportHandler.h.
(WebKit::PageViewportControllerClientEfl::create):
(PageViewportControllerClientEfl):
* UIProcess/API/efl/ewk_view.cpp:
(Ewk_View_Private_Data):
(_ewk_view_initialize):
(ewk_view_scale_set):
* UIProcess/PageViewportController.cpp:
* UIProcess/PageViewportController.h:

Modified Paths

Added Paths

Removed Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (131895 => 131896)


--- trunk/Source/WebKit2/ChangeLog	2012-10-19 13:44:54 UTC (rev 131895)
+++ trunk/Source/WebKit2/ChangeLog	2012-10-19 13:58:03 UTC (rev 131896)
@@ -1,3 +1,44 @@
+2012-10-19  Yael Aharon  <[email protected]>
+
+        [EFL][WK2] Rename EflViewportHandler to PageViewportControllerClientEfl
+        https://bugs.webkit.org/show_bug.cgi?id=99101
+
+        Reviewed by Gyuyoung Kim.
+
+        Rename EFlViewportHandler to PageViewportControllerClientEfl.
+        Also, make it inherit from PageViewportControllerClient. The actual implementation
+        of PageViewportControllerClient for Efl port will come in a separate patch.
+
+        * CMakeLists.txt:
+        * PlatformEfl.cmake:
+        * UIProcess/API/efl/EflViewportHandler.cpp: Removed.
+        * UIProcess/API/efl/EflViewportHandler.h: Removed.
+        * UIProcess/API/efl/PageViewportControllerClientEfl.cpp: Copied from Source/WebKit2/UIProcess/API/efl/EflViewportHandler.cpp.
+        (WebKit::PageViewportControllerClientEfl::PageViewportControllerClientEfl):
+        (WebKit::PageViewportControllerClientEfl::~PageViewportControllerClientEfl):
+        (WebKit::PageViewportControllerClientEfl::drawingArea):
+        (WebKit::PageViewportControllerClientEfl::setRendererActive):
+        (WebKit::PageViewportControllerClientEfl::display):
+        (WebKit::PageViewportControllerClientEfl::updateViewportSize):
+        (WebKit::PageViewportControllerClientEfl::setVisibleContentsRect):
+        (WebKit::PageViewportControllerClientEfl::didChangeContentsSize):
+        (WebKit):
+        (WebKit::PageViewportControllerClientEfl::setViewportPosition):
+        (WebKit::PageViewportControllerClientEfl::setContentsScale):
+        (WebKit::PageViewportControllerClientEfl::didResumeContent):
+        (WebKit::PageViewportControllerClientEfl::didChangeVisibleContents):
+        (WebKit::PageViewportControllerClientEfl::didChangeViewportAttributes):
+        (WebKit::PageViewportControllerClientEfl::setController):
+        * UIProcess/API/efl/PageViewportControllerClientEfl.h: Copied from Source/WebKit2/UIProcess/API/efl/EflViewportHandler.h.
+        (WebKit::PageViewportControllerClientEfl::create):
+        (PageViewportControllerClientEfl):
+        * UIProcess/API/efl/ewk_view.cpp:
+        (Ewk_View_Private_Data):
+        (_ewk_view_initialize):
+        (ewk_view_scale_set):
+        * UIProcess/PageViewportController.cpp:
+        * UIProcess/PageViewportController.h:
+
 2012-10-19  Csaba Osztrogonác  <[email protected]>
 
         REGRESSION(r131844): It broke the build on !ENABLE(NETSCAPE_PLUGIN_API) platforms

Modified: trunk/Source/WebKit2/PlatformEfl.cmake (131895 => 131896)


--- trunk/Source/WebKit2/PlatformEfl.cmake	2012-10-19 13:44:54 UTC (rev 131895)
+++ trunk/Source/WebKit2/PlatformEfl.cmake	2012-10-19 13:58:03 UTC (rev 131896)
@@ -42,7 +42,7 @@
     UIProcess/API/C/soup/WKSoupRequestManager.cpp
 
     UIProcess/API/efl/BatteryProvider.cpp
-    UIProcess/API/efl/EflViewportHandler.cpp
+    UIProcess/API/efl/PageViewportControllerClientEfl.cpp
     UIProcess/API/efl/NetworkInfoProvider.cpp
     UIProcess/API/efl/PageClientImpl.cpp
     UIProcess/API/efl/VibrationProvider.cpp

Deleted: trunk/Source/WebKit2/UIProcess/API/efl/EflViewportHandler.cpp (131895 => 131896)


--- trunk/Source/WebKit2/UIProcess/API/efl/EflViewportHandler.cpp	2012-10-19 13:44:54 UTC (rev 131895)
+++ trunk/Source/WebKit2/UIProcess/API/efl/EflViewportHandler.cpp	2012-10-19 13:58:03 UTC (rev 131896)
@@ -1,112 +0,0 @@
-/*
- * Copyright (C) 2012 Samsung Electronics. All rights reserved.
- *
- * 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 INC. 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 INC. 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 "EflViewportHandler.h"
-
-#if USE(COORDINATED_GRAPHICS)
-
-#include "LayerTreeCoordinatorProxy.h"
-#include "LayerTreeRenderer.h"
-#include "TransformationMatrix.h"
-#include "ewk_view_private.h"
-
-using namespace WebCore;
-
-namespace WebKit {
-
-EflViewportHandler::EflViewportHandler(Evas_Object* viewWidget)
-    : m_viewWidget(viewWidget)
-    , m_scaleFactor(1)
-{
-    ASSERT(m_viewWidget);
-}
-
-EflViewportHandler::~EflViewportHandler()
-{
-}
-
-DrawingAreaProxy* EflViewportHandler::drawingArea() const
-{
-    return ewk_view_page_get(m_viewWidget)->drawingArea();
-}
-
-void EflViewportHandler::setRendererActive(bool active)
-{
-    drawingArea()->layerTreeCoordinatorProxy()->layerTreeRenderer()->setActive(active);
-}
-
-void EflViewportHandler::display(const IntRect& rect, const IntPoint& viewPosition)
-{
-    WebCore::TransformationMatrix matrix;
-    matrix.setMatrix(m_scaleFactor, 0, 0, m_scaleFactor, -m_visibleContentRect.x() + viewPosition.x(), -m_visibleContentRect.y() + viewPosition.y());
-
-    LayerTreeRenderer* renderer = drawingArea()->layerTreeCoordinatorProxy()->layerTreeRenderer();
-    renderer->setActive(true);
-    renderer->syncRemoteContent();
-    IntRect clipRect(rect);
-    clipRect.move(viewPosition.x(), viewPosition.y());
-    renderer->paintToCurrentGLContext(matrix, 1, clipRect);
-}
-
-void EflViewportHandler::updateViewportSize(const IntSize& viewportSize)
-{
-    m_viewportSize = viewportSize;
-    ewk_view_page_get(m_viewWidget)->setViewportSize(viewportSize);
-    setVisibleContentsRect(m_visibleContentRect.location(), m_scaleFactor, FloatPoint());
-}
-
-void EflViewportHandler::setVisibleContentsRect(const IntPoint& newScrollPosition, float newScale, const FloatPoint& trajectory)
-{
-    m_scaleFactor = newScale;
-    m_visibleContentRect = IntRect(newScrollPosition, m_viewportSize);
-
-    // Move visibleContentRect inside contentsRect when visibleContentRect goes outside contentsRect. 
-    IntSize contentsSize = m_contentsSize;
-    contentsSize.scale(m_scaleFactor);
-    if (m_visibleContentRect.x() > contentsSize.width() - m_visibleContentRect.width())
-        m_visibleContentRect.setX(contentsSize.width() - m_visibleContentRect.width());
-    if (m_visibleContentRect.x() < 0)
-        m_visibleContentRect.setX(0);
-    if (m_visibleContentRect.y() > contentsSize.height() - m_visibleContentRect.height())
-        m_visibleContentRect.setY(contentsSize.height() - m_visibleContentRect.height());
-    if (m_visibleContentRect.y() < 0)
-        m_visibleContentRect.setY(0);
-
-    FloatRect mapRectToWebContent = m_visibleContentRect;
-    mapRectToWebContent.scale(1 / m_scaleFactor);
-    drawingArea()->setVisibleContentsRect(enclosingIntRect(mapRectToWebContent), m_scaleFactor, trajectory);
-}
-
-void EflViewportHandler::didChangeContentsSize(const WebCore::IntSize& size)
-{
-    m_contentsSize = size;
-    setVisibleContentsRect(m_visibleContentRect.location(), m_scaleFactor, FloatPoint());
-    drawingArea()->layerTreeCoordinatorProxy()->setContentsSize(WebCore::FloatSize(size.width(), size.height()));
-}
-
-} // namespace WebKit
-#endif // USE(COORDINATED_GRAPHICS)
-

Deleted: trunk/Source/WebKit2/UIProcess/API/efl/EflViewportHandler.h (131895 => 131896)


--- trunk/Source/WebKit2/UIProcess/API/efl/EflViewportHandler.h	2012-10-19 13:44:54 UTC (rev 131895)
+++ trunk/Source/WebKit2/UIProcess/API/efl/EflViewportHandler.h	2012-10-19 13:58:03 UTC (rev 131896)
@@ -1,66 +0,0 @@
-/*
- * Copyright (C) 2012 Samsung Electronics. All rights reserved.
- *
- * 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 INC. 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 INC. 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 EflViewportHandler_h
-#define EflViewportHandler_h
-
-#if USE(COORDINATED_GRAPHICS)
-
-#include "PageClientImpl.h"
-#include <wtf/PassOwnPtr.h>
-
-namespace WebKit {
-
-class EflViewportHandler {
-public:
-    static PassOwnPtr<EflViewportHandler> create(Evas_Object* viewWidget)
-    {
-        return adoptPtr(new EflViewportHandler(viewWidget));
-    }
-    ~EflViewportHandler();
-
-    DrawingAreaProxy* drawingArea() const;
-    WebCore::IntSize viewSize() { return m_viewportSize; }
-
-    void display(const WebCore::IntRect& rect, const WebCore::IntPoint& viewPosition);
-    void updateViewportSize(const WebCore::IntSize& viewportSize);
-    void setVisibleContentsRect(const WebCore::IntPoint&, float, const WebCore::FloatPoint&);
-    void didChangeContentsSize(const WebCore::IntSize& size);
-    void setRendererActive(bool);
-private:
-    explicit EflViewportHandler(Evas_Object*);
-
-    Evas_Object* m_viewWidget;
-    WebCore::IntRect m_visibleContentRect;
-    WebCore::IntSize m_contentsSize;
-    WebCore::IntSize m_viewportSize;
-    float m_scaleFactor;
-};
-
-} // namespace WebKit
-
-#endif
-
-#endif // EflViewportHandler_h

Copied: trunk/Source/WebKit2/UIProcess/API/efl/PageViewportControllerClientEfl.cpp (from rev 131895, trunk/Source/WebKit2/UIProcess/API/efl/EflViewportHandler.cpp) (0 => 131896)


--- trunk/Source/WebKit2/UIProcess/API/efl/PageViewportControllerClientEfl.cpp	                        (rev 0)
+++ trunk/Source/WebKit2/UIProcess/API/efl/PageViewportControllerClientEfl.cpp	2012-10-19 13:58:03 UTC (rev 131896)
@@ -0,0 +1,136 @@
+/*
+ * Copyright (C) 2012 Samsung Electronics. All rights reserved.
+ *
+ * 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 INC. 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 INC. 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 "PageViewportControllerClientEfl.h"
+
+#if USE(COORDINATED_GRAPHICS)
+
+#include "LayerTreeCoordinatorProxy.h"
+#include "LayerTreeRenderer.h"
+#include "TransformationMatrix.h"
+#include "ewk_view_private.h"
+
+using namespace WebCore;
+
+namespace WebKit {
+
+PageViewportControllerClientEfl::PageViewportControllerClientEfl(Evas_Object* viewWidget)
+    : m_viewWidget(viewWidget)
+    , m_scaleFactor(1)
+{
+    ASSERT(m_viewWidget);
+}
+
+PageViewportControllerClientEfl::~PageViewportControllerClientEfl()
+{
+}
+
+DrawingAreaProxy* PageViewportControllerClientEfl::drawingArea() const
+{
+    return ewk_view_page_get(m_viewWidget)->drawingArea();
+}
+
+void PageViewportControllerClientEfl::setRendererActive(bool active)
+{
+    drawingArea()->layerTreeCoordinatorProxy()->layerTreeRenderer()->setActive(active);
+}
+
+void PageViewportControllerClientEfl::display(const IntRect& rect, const IntPoint& viewPosition)
+{
+    WebCore::TransformationMatrix matrix;
+    matrix.setMatrix(m_scaleFactor, 0, 0, m_scaleFactor, -m_visibleContentRect.x() + viewPosition.x(), -m_visibleContentRect.y() + viewPosition.y());
+
+    LayerTreeRenderer* renderer = drawingArea()->layerTreeCoordinatorProxy()->layerTreeRenderer();
+    renderer->setActive(true);
+    renderer->syncRemoteContent();
+    IntRect clipRect(rect);
+    clipRect.move(viewPosition.x(), viewPosition.y());
+    renderer->paintToCurrentGLContext(matrix, 1, clipRect);
+}
+
+void PageViewportControllerClientEfl::updateViewportSize(const IntSize& viewportSize)
+{
+    m_viewportSize = viewportSize;
+    ewk_view_page_get(m_viewWidget)->setViewportSize(viewportSize);
+    setVisibleContentsRect(m_visibleContentRect.location(), m_scaleFactor, FloatPoint());
+}
+
+void PageViewportControllerClientEfl::setVisibleContentsRect(const IntPoint& newScrollPosition, float newScale, const FloatPoint& trajectory)
+{
+    m_scaleFactor = newScale;
+    m_visibleContentRect = IntRect(newScrollPosition, m_viewportSize);
+
+    // Move visibleContentRect inside contentsRect when visibleContentRect goes outside contentsRect. 
+    IntSize contentsSize = m_contentsSize;
+    contentsSize.scale(m_scaleFactor);
+    if (m_visibleContentRect.x() > contentsSize.width() - m_visibleContentRect.width())
+        m_visibleContentRect.setX(contentsSize.width() - m_visibleContentRect.width());
+    if (m_visibleContentRect.x() < 0)
+        m_visibleContentRect.setX(0);
+    if (m_visibleContentRect.y() > contentsSize.height() - m_visibleContentRect.height())
+        m_visibleContentRect.setY(contentsSize.height() - m_visibleContentRect.height());
+    if (m_visibleContentRect.y() < 0)
+        m_visibleContentRect.setY(0);
+
+    FloatRect mapRectToWebContent = m_visibleContentRect;
+    mapRectToWebContent.scale(1 / m_scaleFactor);
+    drawingArea()->setVisibleContentsRect(enclosingIntRect(mapRectToWebContent), m_scaleFactor, trajectory);
+}
+
+void PageViewportControllerClientEfl::didChangeContentsSize(const WebCore::IntSize& size)
+{
+    m_contentsSize = size;
+    setVisibleContentsRect(m_visibleContentRect.location(), m_scaleFactor, FloatPoint());
+    drawingArea()->layerTreeCoordinatorProxy()->setContentsSize(WebCore::FloatSize(size.width(), size.height()));
+}
+
+void PageViewportControllerClientEfl::setViewportPosition(const WebCore::FloatPoint& /*contentsPoint*/)
+{
+}
+
+void PageViewportControllerClientEfl::setContentsScale(float, bool /*treatAsInitialValue*/)
+{
+}
+
+void PageViewportControllerClientEfl::didResumeContent()
+{
+}
+
+void PageViewportControllerClientEfl::didChangeVisibleContents()
+{
+}
+
+void PageViewportControllerClientEfl::didChangeViewportAttributes()
+{
+}
+
+void PageViewportControllerClientEfl::setController(PageViewportController* pageViewportController)
+{
+}
+
+} // namespace WebKit
+#endif // USE(COORDINATED_GRAPHICS)
+

Copied: trunk/Source/WebKit2/UIProcess/API/efl/PageViewportControllerClientEfl.h (from rev 131895, trunk/Source/WebKit2/UIProcess/API/efl/EflViewportHandler.h) (0 => 131896)


--- trunk/Source/WebKit2/UIProcess/API/efl/PageViewportControllerClientEfl.h	                        (rev 0)
+++ trunk/Source/WebKit2/UIProcess/API/efl/PageViewportControllerClientEfl.h	2012-10-19 13:58:03 UTC (rev 131896)
@@ -0,0 +1,77 @@
+/*
+ * Copyright (C) 2012 Samsung Electronics. All rights reserved.
+ *
+ * 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 INC. 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 INC. 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 PageViewportControllerClientEfl_h
+#define PageViewportControllerClientEfl_h
+
+#if USE(COORDINATED_GRAPHICS)
+
+#include "PageClientImpl.h"
+#include "PageViewportControllerClient.h"
+#include <wtf/PassOwnPtr.h>
+
+namespace WebKit {
+
+class PageViewportControllerClientEfl : public PageViewportControllerClient {
+public:
+    static PassOwnPtr<PageViewportControllerClientEfl> create(Evas_Object* viewWidget)
+    {
+        return adoptPtr(new PageViewportControllerClientEfl(viewWidget));
+    }
+    ~PageViewportControllerClientEfl();
+
+    DrawingAreaProxy* drawingArea() const;
+    WebCore::IntSize viewSize() { return m_viewportSize; }
+
+    void display(const WebCore::IntRect& rect, const WebCore::IntPoint& viewPosition);
+    void updateViewportSize(const WebCore::IntSize& viewportSize);
+    void setVisibleContentsRect(const WebCore::IntPoint&, float, const WebCore::FloatPoint&);
+    void setRendererActive(bool);
+
+    virtual void setViewportPosition(const WebCore::FloatPoint& contentsPoint);
+    virtual void setContentsScale(float, bool treatAsInitialValue);
+
+    virtual void didResumeContent();
+    virtual void didChangeContentsSize(const WebCore::IntSize&);
+    virtual void didChangeVisibleContents();
+    virtual void didChangeViewportAttributes();
+
+    virtual void setController(PageViewportController*);
+
+private:
+    explicit PageViewportControllerClientEfl(Evas_Object*);
+
+    Evas_Object* m_viewWidget;
+    WebCore::IntRect m_visibleContentRect;
+    WebCore::IntSize m_contentsSize;
+    WebCore::IntSize m_viewportSize;
+    float m_scaleFactor;
+};
+
+} // namespace WebKit
+
+#endif
+
+#endif // PageViewportControllerClientEfl_h

Modified: trunk/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp (131895 => 131896)


--- trunk/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp	2012-10-19 13:44:54 UTC (rev 131895)
+++ trunk/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp	2012-10-19 13:58:03 UTC (rev 131896)
@@ -75,7 +75,7 @@
 #endif
 
 #if USE(COORDINATED_GRAPHICS)
-#include "EflViewportHandler.h"
+#include "PageViewportControllerClientEfl.h"
 #endif
 
 using namespace WebKit;
@@ -115,7 +115,7 @@
 struct Ewk_View_Private_Data {
     OwnPtr<PageClientImpl> pageClient;
 #if USE(COORDINATED_GRAPHICS)
-    OwnPtr<EflViewportHandler> viewportHandler;
+    OwnPtr<PageViewportControllerClientEfl> pageViewportControllerClient;
 #endif
     RefPtr<WebPageProxy> pageProxy;
 
@@ -623,7 +623,7 @@
         return false;
     }
 
-    priv->viewportHandler->setRendererActive(true);
+    priv->pageViewportControllerClient->setRendererActive(true);
     return true;
 }
 
@@ -667,7 +667,7 @@
 
     if (smartData->changed.size) {
 #if USE(COORDINATED_GRAPHICS)
-        priv->viewportHandler->updateViewportSize(IntSize(width, height));
+        priv->pageViewportControllerClient->updateViewportSize(IntSize(width, height));
 #endif
 #if USE(ACCELERATED_COMPOSITING)
         needsNewSurface = priv->evasGlSurface;
@@ -824,7 +824,7 @@
     priv->context = ewk_context_ref(context);
 
 #if USE(COORDINATED_GRAPHICS)
-    priv->viewportHandler = EflViewportHandler::create(ewkView);
+    priv->pageViewportControllerClient = PageViewportControllerClientEfl::create(ewkView);
 #endif
 
     WKPageRef wkPage = toAPI(priv->pageProxy.get());
@@ -1295,7 +1295,7 @@
     EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv);
 
     evas_gl_make_current(priv->evasGl, priv->evasGlSurface, priv->evasGlContext);
-    priv->viewportHandler->display(rect, IntPoint(smartData->view.x, smartData->view.y));
+    priv->pageViewportControllerClient->display(rect, IntPoint(smartData->view.x, smartData->view.y));
 #endif
 
     evas_object_image_data_update_add(smartData->image, rect.x(), rect.y(), rect.width(), rect.height());
@@ -1733,7 +1733,7 @@
     EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData);
     EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv);
 
-    priv->viewportHandler->didChangeContentsSize(size);
+    priv->pageViewportControllerClient->didChangeContentsSize(size);
 #else
     UNUSED_PARAM(ewkView);
     UNUSED_PARAM(size);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to