Title: [141428] trunk
Revision
141428
Author
[email protected]
Date
2013-01-31 09:44:08 -0800 (Thu, 31 Jan 2013)

Log Message

[chromium] Remove dead transitional code from WebViewImpl
https://bugs.webkit.org/show_bug.cgi?id=107889

Patch by James Robinson <[email protected]> on 2013-01-31
Reviewed by Adam Barth.

Source/WebKit/chromium:

The chromium side of this landed at r178256 and seems stable.

* public/WebWidget.h:
(WebKit::WebWidget::setCompositorSurfaceReady):
* src/WebViewImpl.cpp:
(WebKit::WebViewImpl::WebViewImpl):
(WebKit::WebViewImpl::~WebViewImpl):
(WebKit):
(WebKit::WebViewImpl::setIsTransparent):
(WebKit::WebViewImpl::setIsAcceleratedCompositingActive):
* src/WebViewImpl.h:
* tests/ScrollingCoordinatorChromiumTest.cpp:
(WebKit::FakeWebViewClient::initializeLayerTreeView):
(FakeWebViewClient):
(WebKit::FakeWebViewClient::layerTreeView):
(WebKit::ScrollingCoordinatorChromiumTest::ScrollingCoordinatorChromiumTest):
(ScrollingCoordinatorChromiumTest):

Tools:

ScrollingCoordinatorChromiumTests need to initialize compositing, so its implementation of
WebWidgetClient has to support the new compositor initialization path.

* DumpRenderTree/chromium/WebViewHost.cpp:
(WebViewHost::initializeLayerTreeView):
(WebViewHost::setWebWidget):

Modified Paths

Diff

Modified: trunk/Source/WebKit/chromium/ChangeLog (141427 => 141428)


--- trunk/Source/WebKit/chromium/ChangeLog	2013-01-31 17:36:46 UTC (rev 141427)
+++ trunk/Source/WebKit/chromium/ChangeLog	2013-01-31 17:44:08 UTC (rev 141428)
@@ -1,3 +1,28 @@
+2013-01-31  James Robinson  <[email protected]>
+
+        [chromium] Remove dead transitional code from WebViewImpl
+        https://bugs.webkit.org/show_bug.cgi?id=107889
+
+        Reviewed by Adam Barth.
+
+        The chromium side of this landed at r178256 and seems stable.
+
+        * public/WebWidget.h:
+        (WebKit::WebWidget::setCompositorSurfaceReady):
+        * src/WebViewImpl.cpp:
+        (WebKit::WebViewImpl::WebViewImpl):
+        (WebKit::WebViewImpl::~WebViewImpl):
+        (WebKit):
+        (WebKit::WebViewImpl::setIsTransparent):
+        (WebKit::WebViewImpl::setIsAcceleratedCompositingActive):
+        * src/WebViewImpl.h:
+        * tests/ScrollingCoordinatorChromiumTest.cpp:
+        (WebKit::FakeWebViewClient::initializeLayerTreeView):
+        (FakeWebViewClient):
+        (WebKit::FakeWebViewClient::layerTreeView):
+        (WebKit::ScrollingCoordinatorChromiumTest::ScrollingCoordinatorChromiumTest):
+        (ScrollingCoordinatorChromiumTest):
+
 2013-01-31  Kentaro Hara  <[email protected]>
 
         Rename WheelEvent::Granularity to WheelEvent::DeltaMode

Modified: trunk/Source/WebKit/chromium/public/WebWidget.h (141427 => 141428)


--- trunk/Source/WebKit/chromium/public/WebWidget.h	2013-01-31 17:36:46 UTC (rev 141427)
+++ trunk/Source/WebKit/chromium/public/WebWidget.h	2013-01-31 17:44:08 UTC (rev 141428)
@@ -129,22 +129,13 @@
 
     // Indicates that the compositing surface associated with this WebWidget is
     // ready to use.
-    virtual void setCompositorSurfaceReady() = 0;
+    virtual void setCompositorSurfaceReady() { }
 
     // Temporary method for the embedder to notify the WebWidget that the widget
     // has taken damage, e.g. due to a window expose. This method will be
     // removed when the WebWidget inversion patch lands --- http://crbug.com/112837
     virtual void setNeedsRedraw() { }
 
-    // Temporary method for the embedder to check for throttled input. When this
-    // is true, the WebWidget is indicating that it would prefer to not receive
-    // additional input events until
-    // WebWidgetClient::didBecomeReadyForAdditionalInput is called.
-    //
-    // This method will be removed when the WebWidget inversion patch lands ---
-    // http://crbug.com/112837
-    virtual bool isInputThrottled() const { return false; }
-
     // Called to inform the WebWidget of a change in theme.
     // Implementors that cache rendered copies of widgets need to re-render
     // on receiving this message
@@ -247,11 +238,6 @@
     // following the call to instrumentBeginFrame().
     virtual void instrumentCancelFrame() { }
 
-    // Fills in a WebRenderingStats struct containing information about rendering, e.g. count of frames rendered, time spent painting.
-    // This call is relatively expensive in threaded compositing mode, as it blocks on the compositor thread.
-    // It is safe to call in software mode, but will only give stats for rendering done in compositing mode.
-    virtual void renderingStats(WebRenderingStats&) const { }
-
     // The page background color. Can be used for filling in areas without
     // content.
     virtual WebColor backgroundColor() const { return 0xFFFFFFFF; /* SK_ColorWHITE */ }

Modified: trunk/Source/WebKit/chromium/src/WebViewImpl.cpp (141427 => 141428)


--- trunk/Source/WebKit/chromium/src/WebViewImpl.cpp	2013-01-31 17:36:46 UTC (rev 141427)
+++ trunk/Source/WebKit/chromium/src/WebViewImpl.cpp	2013-01-31 17:44:08 UTC (rev 141428)
@@ -418,14 +418,12 @@
     , m_benchmarkSupport(this)
 #if USE(ACCELERATED_COMPOSITING)
     , m_layerTreeView(0)
-    , m_ownsLayerTreeView(false)
     , m_rootLayer(0)
     , m_rootGraphicsLayer(0)
     , m_isAcceleratedCompositingActive(false)
     , m_layerTreeViewCommitsDeferred(false)
     , m_compositorCreationFailed(false)
     , m_recreatingGraphicsContext(false)
-    , m_compositorSurfaceReady(false)
     , m_inputHandlerIdentifier(-1)
 #endif
 #if ENABLE(INPUT_SPEECH)
@@ -511,8 +509,6 @@
 
 WebViewImpl::~WebViewImpl()
 {
-    if (m_ownsLayerTreeView)
-        delete m_layerTreeView;
     ASSERT(!m_page);
 }
 
@@ -840,12 +836,6 @@
     scheduleAnimation();
 }
 
-void WebViewImpl::renderingStats(WebRenderingStats& stats) const
-{
-    if (m_layerTreeView)
-        m_layerTreeView->renderingStats(stats);
-}
-
 void WebViewImpl::startPageScaleAnimation(const IntPoint& targetPosition, bool useAnchor, float newScale, double durationInSeconds)
 {
     WebPoint clampedPoint = targetPosition;
@@ -1791,13 +1781,6 @@
 }
 #endif
 
-void WebViewImpl::setCompositorSurfaceReady()
-{
-    m_compositorSurfaceReady = true;
-    if (m_layerTreeView)
-        m_layerTreeView->setSurfaceReady();
-}
-
 void WebViewImpl::animate(double)
 {
 #if ENABLE(REQUEST_ANIMATION_FRAME)
@@ -1977,15 +1960,6 @@
 #endif
 }
 
-bool WebViewImpl::isInputThrottled() const
-{
-#if USE(ACCELERATED_COMPOSITING)
-    if (m_layerTreeView && isAcceleratedCompositingActive())
-        return m_layerTreeView->commitRequested();
-#endif
-    return false;
-}
-
 void WebViewImpl::enterFullScreenForElement(WebCore::Element* element)
 {
     // We are already transitioning to fullscreen for a different element.
@@ -3645,9 +3619,6 @@
 
     if (m_nonCompositedContentHost)
         m_nonCompositedContentHost->setOpaque(!isTransparent);
-
-    if (m_layerTreeView)
-        m_layerTreeView->setHasTransparentBackground(isTransparent);
 }
 
 bool WebViewImpl::isTransparent() const
@@ -4127,10 +4098,6 @@
 
         m_client->initializeLayerTreeView(this, *m_rootLayer, layerTreeViewSettings);
         m_layerTreeView = m_client->layerTreeView();
-        if (!m_layerTreeView) {
-            m_layerTreeView = Platform::current()->compositorSupport()->createLayerTreeView(this, *m_rootLayer, layerTreeViewSettings);
-            m_ownsLayerTreeView = true;
-        }
         if (m_layerTreeView) {
             if (m_webSettings->applyDeviceScaleFactorInCompositor() && page()->deviceScaleFactor() != 1)
                 setDeviceScaleFactor(page()->deviceScaleFactor());
@@ -4138,8 +4105,6 @@
             bool visible = page()->visibilityState() == PageVisibilityStateVisible;
             m_layerTreeView->setVisible(visible);
             m_layerTreeView->setPageScaleFactorAndLimits(pageScaleFactor(), m_minimumPageScaleFactor, m_maximumPageScaleFactor);
-            if (m_compositorSurfaceReady)
-                m_layerTreeView->setSurfaceReady();
             m_layerTreeView->setHasTransparentBackground(isTransparent());
             updateLayerTreeViewport();
             m_client->didActivateCompositor(m_inputHandlerIdentifier);

Modified: trunk/Source/WebKit/chromium/src/WebViewImpl.h (141427 => 141428)


--- trunk/Source/WebKit/chromium/src/WebViewImpl.h	2013-01-31 17:36:46 UTC (rev 141427)
+++ trunk/Source/WebKit/chromium/src/WebViewImpl.h	2013-01-31 17:44:08 UTC (rev 141428)
@@ -143,7 +143,6 @@
     virtual void didEnterFullScreen();
     virtual void willExitFullScreen();
     virtual void didExitFullScreen();
-    virtual void setCompositorSurfaceReady();
     virtual void animate(double);
     virtual void layout(); // Also implements WebLayerTreeViewClient::layout()
     virtual void enterForceCompositingMode(bool enable) OVERRIDE;
@@ -152,7 +151,6 @@
     virtual void themeChanged();
     virtual void composite(bool finish);
     virtual void setNeedsRedraw();
-    virtual bool isInputThrottled() const;
     virtual bool handleInputEvent(const WebInputEvent&);
     virtual bool hasTouchEventHandlersAt(const WebPoint&);
     virtual void mouseCaptureLost();
@@ -184,7 +182,6 @@
     virtual void didChangeWindowResizerRect();
     virtual void instrumentBeginFrame();
     virtual void instrumentCancelFrame();
-    virtual void renderingStats(WebRenderingStats&) const;
 
     // WebView methods:
     virtual void initializeMainFrame(WebFrameClient*);
@@ -850,7 +847,6 @@
     WebCore::IntRect m_rootLayerScrollDamage;
     OwnPtr<NonCompositedContentHost> m_nonCompositedContentHost;
     WebLayerTreeView* m_layerTreeView;
-    bool m_ownsLayerTreeView;
     WebLayer* m_rootLayer;
     WebCore::GraphicsLayer* m_rootGraphicsLayer;
     bool m_isAcceleratedCompositingActive;
@@ -858,7 +854,6 @@
     bool m_compositorCreationFailed;
     // If true, the graphics context is being restored.
     bool m_recreatingGraphicsContext;
-    bool m_compositorSurfaceReady;
     int m_inputHandlerIdentifier;
 #endif
     static const WebInputEvent* m_currentInputEvent;

Modified: trunk/Source/WebKit/chromium/tests/ScrollingCoordinatorChromiumTest.cpp (141427 => 141428)


--- trunk/Source/WebKit/chromium/tests/ScrollingCoordinatorChromiumTest.cpp	2013-01-31 17:36:46 UTC (rev 141427)
+++ trunk/Source/WebKit/chromium/tests/ScrollingCoordinatorChromiumTest.cpp	2013-01-31 17:44:08 UTC (rev 141428)
@@ -52,12 +52,26 @@
 
 namespace {
 
-class MockWebViewClient : public WebViewClient {
+class FakeWebViewClient : public WebViewClient {
 public:
     virtual WebCompositorOutputSurface* createOutputSurface() OVERRIDE
     {
         return Platform::current()->compositorSupport()->createOutputSurfaceFor3D(CompositorFakeWebGraphicsContext3D::create(WebGraphicsContext3D::Attributes()).leakPtr());
     }
+
+    virtual void initializeLayerTreeView(WebLayerTreeViewClient* client, const WebLayer& rootLayer, const WebLayerTreeView::Settings& settings)
+    {
+        m_layerTreeView = adoptPtr(Platform::current()->compositorSupport()->createLayerTreeView(client, rootLayer, settings));
+        ASSERT(m_layerTreeView);
+    }
+
+    virtual WebLayerTreeView* layerTreeView()
+    {
+        return m_layerTreeView.get();
+    }
+
+private:
+    OwnPtr<WebLayerTreeView> m_layerTreeView;
 };
 
 class MockWebFrameClient : public WebFrameClient {
@@ -67,7 +81,6 @@
 public:
     ScrollingCoordinatorChromiumTest()
         : m_baseURL("http://www.test.com/")
-        , m_webCompositorInitializer(0)
     {
         Platform::current()->compositorSupport()->initialize(0);
 
@@ -115,8 +128,7 @@
 protected:
     std::string m_baseURL;
     MockWebFrameClient m_mockWebFrameClient;
-    MockWebViewClient m_mockWebViewClient;
-    WebKitTests::WebCompositorInitializer m_webCompositorInitializer;
+    FakeWebViewClient m_mockWebViewClient;
     WebViewImpl* m_webViewImpl;
 };
 

Modified: trunk/Tools/ChangeLog (141427 => 141428)


--- trunk/Tools/ChangeLog	2013-01-31 17:36:46 UTC (rev 141427)
+++ trunk/Tools/ChangeLog	2013-01-31 17:44:08 UTC (rev 141428)
@@ -1,3 +1,17 @@
+2013-01-31  James Robinson  <[email protected]>
+
+        [chromium] Remove dead transitional code from WebViewImpl
+        https://bugs.webkit.org/show_bug.cgi?id=107889
+
+        Reviewed by Adam Barth.
+
+        ScrollingCoordinatorChromiumTests need to initialize compositing, so its implementation of
+        WebWidgetClient has to support the new compositor initialization path.
+
+        * DumpRenderTree/chromium/WebViewHost.cpp:
+        (WebViewHost::initializeLayerTreeView):
+        (WebViewHost::setWebWidget):
+
 2013-01-31  Gustavo Noronha Silva  <[email protected]>
 
         [GTK] run-gtk-tests does not respect the -d argument

Modified: trunk/Tools/DumpRenderTree/chromium/WebViewHost.cpp (141427 => 141428)


--- trunk/Tools/DumpRenderTree/chromium/WebViewHost.cpp	2013-01-31 17:36:46 UTC (rev 141427)
+++ trunk/Tools/DumpRenderTree/chromium/WebViewHost.cpp	2013-01-31 17:44:08 UTC (rev 141428)
@@ -349,6 +349,8 @@
 void WebViewHost::initializeLayerTreeView(WebLayerTreeViewClient* client, const WebLayer& rootLayer, const WebLayerTreeView::Settings& settings)
 {
     m_layerTreeView = adoptPtr(Platform::current()->compositorSupport()->createLayerTreeView(client, rootLayer, settings));
+    if (m_layerTreeView)
+        m_layerTreeView->setSurfaceReady();
 }
 
 WebLayerTreeView* WebViewHost::layerTreeView()
@@ -1012,7 +1014,6 @@
     m_webWidget = widget;
     webView()->setSpellCheckClient(proxy()->spellCheckClient());
     webView()->setPrerendererClient(this);
-    webView()->setCompositorSurfaceReady();
 }
 
 WebView* WebViewHost::webView() const
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to