Changeset 141428 in webkit


Ignore:
Timestamp:
Jan 31, 2013 9:44:08 AM (11 years ago)
Author:
commit-queue@webkit.org
Message:

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

Patch by James Robinson <jamesr@chromium.org> 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):

Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/chromium/ChangeLog

    r141394 r141428  
     12013-01-31  James Robinson  <jamesr@chromium.org>
     2
     3        [chromium] Remove dead transitional code from WebViewImpl
     4        https://bugs.webkit.org/show_bug.cgi?id=107889
     5
     6        Reviewed by Adam Barth.
     7
     8        The chromium side of this landed at r178256 and seems stable.
     9
     10        * public/WebWidget.h:
     11        (WebKit::WebWidget::setCompositorSurfaceReady):
     12        * src/WebViewImpl.cpp:
     13        (WebKit::WebViewImpl::WebViewImpl):
     14        (WebKit::WebViewImpl::~WebViewImpl):
     15        (WebKit):
     16        (WebKit::WebViewImpl::setIsTransparent):
     17        (WebKit::WebViewImpl::setIsAcceleratedCompositingActive):
     18        * src/WebViewImpl.h:
     19        * tests/ScrollingCoordinatorChromiumTest.cpp:
     20        (WebKit::FakeWebViewClient::initializeLayerTreeView):
     21        (FakeWebViewClient):
     22        (WebKit::FakeWebViewClient::layerTreeView):
     23        (WebKit::ScrollingCoordinatorChromiumTest::ScrollingCoordinatorChromiumTest):
     24        (ScrollingCoordinatorChromiumTest):
     25
    1262013-01-31  Kentaro Hara  <haraken@chromium.org>
    227
  • trunk/Source/WebKit/chromium/public/WebWidget.h

    r140808 r141428  
    130130    // Indicates that the compositing surface associated with this WebWidget is
    131131    // ready to use.
    132     virtual void setCompositorSurfaceReady() = 0;
     132    virtual void setCompositorSurfaceReady() { }
    133133
    134134    // Temporary method for the embedder to notify the WebWidget that the widget
     
    136136    // removed when the WebWidget inversion patch lands --- http://crbug.com/112837
    137137    virtual void setNeedsRedraw() { }
    138 
    139     // Temporary method for the embedder to check for throttled input. When this
    140     // is true, the WebWidget is indicating that it would prefer to not receive
    141     // additional input events until
    142     // WebWidgetClient::didBecomeReadyForAdditionalInput is called.
    143     //
    144     // This method will be removed when the WebWidget inversion patch lands ---
    145     // http://crbug.com/112837
    146     virtual bool isInputThrottled() const { return false; }
    147138
    148139    // Called to inform the WebWidget of a change in theme.
     
    248239    virtual void instrumentCancelFrame() { }
    249240
    250     // Fills in a WebRenderingStats struct containing information about rendering, e.g. count of frames rendered, time spent painting.
    251     // This call is relatively expensive in threaded compositing mode, as it blocks on the compositor thread.
    252     // It is safe to call in software mode, but will only give stats for rendering done in compositing mode.
    253     virtual void renderingStats(WebRenderingStats&) const { }
    254 
    255241    // The page background color. Can be used for filling in areas without
    256242    // content.
  • trunk/Source/WebKit/chromium/src/WebViewImpl.cpp

    r141318 r141428  
    419419#if USE(ACCELERATED_COMPOSITING)
    420420    , m_layerTreeView(0)
    421     , m_ownsLayerTreeView(false)
    422421    , m_rootLayer(0)
    423422    , m_rootGraphicsLayer(0)
     
    426425    , m_compositorCreationFailed(false)
    427426    , m_recreatingGraphicsContext(false)
    428     , m_compositorSurfaceReady(false)
    429427    , m_inputHandlerIdentifier(-1)
    430428#endif
     
    512510WebViewImpl::~WebViewImpl()
    513511{
    514     if (m_ownsLayerTreeView)
    515         delete m_layerTreeView;
    516512    ASSERT(!m_page);
    517513}
     
    839835    m_gestureAnimation = WebActiveGestureAnimation::createWithTimeOffset(curve.release(), this, parameters.startTime);
    840836    scheduleAnimation();
    841 }
    842 
    843 void WebViewImpl::renderingStats(WebRenderingStats& stats) const
    844 {
    845     if (m_layerTreeView)
    846         m_layerTreeView->renderingStats(stats);
    847837}
    848838
     
    17921782#endif
    17931783
    1794 void WebViewImpl::setCompositorSurfaceReady()
    1795 {
    1796     m_compositorSurfaceReady = true;
    1797     if (m_layerTreeView)
    1798         m_layerTreeView->setSurfaceReady();
    1799 }
    1800 
    18011784void WebViewImpl::animate(double)
    18021785{
     
    19761959        m_layerTreeView->setNeedsRedraw();
    19771960#endif
    1978 }
    1979 
    1980 bool WebViewImpl::isInputThrottled() const
    1981 {
    1982 #if USE(ACCELERATED_COMPOSITING)
    1983     if (m_layerTreeView && isAcceleratedCompositingActive())
    1984         return m_layerTreeView->commitRequested();
    1985 #endif
    1986     return false;
    19871961}
    19881962
     
    36463620    if (m_nonCompositedContentHost)
    36473621        m_nonCompositedContentHost->setOpaque(!isTransparent);
    3648 
    3649     if (m_layerTreeView)
    3650         m_layerTreeView->setHasTransparentBackground(isTransparent);
    36513622}
    36523623
     
    41284099        m_client->initializeLayerTreeView(this, *m_rootLayer, layerTreeViewSettings);
    41294100        m_layerTreeView = m_client->layerTreeView();
    4130         if (!m_layerTreeView) {
    4131             m_layerTreeView = Platform::current()->compositorSupport()->createLayerTreeView(this, *m_rootLayer, layerTreeViewSettings);
    4132             m_ownsLayerTreeView = true;
    4133         }
    41344101        if (m_layerTreeView) {
    41354102            if (m_webSettings->applyDeviceScaleFactorInCompositor() && page()->deviceScaleFactor() != 1)
     
    41394106            m_layerTreeView->setVisible(visible);
    41404107            m_layerTreeView->setPageScaleFactorAndLimits(pageScaleFactor(), m_minimumPageScaleFactor, m_maximumPageScaleFactor);
    4141             if (m_compositorSurfaceReady)
    4142                 m_layerTreeView->setSurfaceReady();
    41434108            m_layerTreeView->setHasTransparentBackground(isTransparent());
    41444109            updateLayerTreeViewport();
  • trunk/Source/WebKit/chromium/src/WebViewImpl.h

    r141231 r141428  
    144144    virtual void willExitFullScreen();
    145145    virtual void didExitFullScreen();
    146     virtual void setCompositorSurfaceReady();
    147146    virtual void animate(double);
    148147    virtual void layout(); // Also implements WebLayerTreeViewClient::layout()
     
    153152    virtual void composite(bool finish);
    154153    virtual void setNeedsRedraw();
    155     virtual bool isInputThrottled() const;
    156154    virtual bool handleInputEvent(const WebInputEvent&);
    157155    virtual bool hasTouchEventHandlersAt(const WebPoint&);
     
    185183    virtual void instrumentBeginFrame();
    186184    virtual void instrumentCancelFrame();
    187     virtual void renderingStats(WebRenderingStats&) const;
    188185
    189186    // WebView methods:
     
    851848    OwnPtr<NonCompositedContentHost> m_nonCompositedContentHost;
    852849    WebLayerTreeView* m_layerTreeView;
    853     bool m_ownsLayerTreeView;
    854850    WebLayer* m_rootLayer;
    855851    WebCore::GraphicsLayer* m_rootGraphicsLayer;
     
    859855    // If true, the graphics context is being restored.
    860856    bool m_recreatingGraphicsContext;
    861     bool m_compositorSurfaceReady;
    862857    int m_inputHandlerIdentifier;
    863858#endif
  • trunk/Source/WebKit/chromium/tests/ScrollingCoordinatorChromiumTest.cpp

    r137811 r141428  
    5353namespace {
    5454
    55 class MockWebViewClient : public WebViewClient {
     55class FakeWebViewClient : public WebViewClient {
    5656public:
    5757    virtual WebCompositorOutputSurface* createOutputSurface() OVERRIDE
     
    5959        return Platform::current()->compositorSupport()->createOutputSurfaceFor3D(CompositorFakeWebGraphicsContext3D::create(WebGraphicsContext3D::Attributes()).leakPtr());
    6060    }
     61
     62    virtual void initializeLayerTreeView(WebLayerTreeViewClient* client, const WebLayer& rootLayer, const WebLayerTreeView::Settings& settings)
     63    {
     64        m_layerTreeView = adoptPtr(Platform::current()->compositorSupport()->createLayerTreeView(client, rootLayer, settings));
     65        ASSERT(m_layerTreeView);
     66    }
     67
     68    virtual WebLayerTreeView* layerTreeView()
     69    {
     70        return m_layerTreeView.get();
     71    }
     72
     73private:
     74    OwnPtr<WebLayerTreeView> m_layerTreeView;
    6175};
    6276
     
    6882    ScrollingCoordinatorChromiumTest()
    6983        : m_baseURL("http://www.test.com/")
    70         , m_webCompositorInitializer(0)
    7184    {
    7285        Platform::current()->compositorSupport()->initialize(0);
     
    116129    std::string m_baseURL;
    117130    MockWebFrameClient m_mockWebFrameClient;
    118     MockWebViewClient m_mockWebViewClient;
    119     WebKitTests::WebCompositorInitializer m_webCompositorInitializer;
     131    FakeWebViewClient m_mockWebViewClient;
    120132    WebViewImpl* m_webViewImpl;
    121133};
  • trunk/Tools/ChangeLog

    r141402 r141428  
     12013-01-31  James Robinson  <jamesr@chromium.org>
     2
     3        [chromium] Remove dead transitional code from WebViewImpl
     4        https://bugs.webkit.org/show_bug.cgi?id=107889
     5
     6        Reviewed by Adam Barth.
     7
     8        ScrollingCoordinatorChromiumTests need to initialize compositing, so its implementation of
     9        WebWidgetClient has to support the new compositor initialization path.
     10
     11        * DumpRenderTree/chromium/WebViewHost.cpp:
     12        (WebViewHost::initializeLayerTreeView):
     13        (WebViewHost::setWebWidget):
     14
    1152013-01-31  Gustavo Noronha Silva  <gns@gnome.org>
    216
  • trunk/Tools/DumpRenderTree/chromium/WebViewHost.cpp

    r141392 r141428  
    350350{
    351351    m_layerTreeView = adoptPtr(Platform::current()->compositorSupport()->createLayerTreeView(client, rootLayer, settings));
     352    if (m_layerTreeView)
     353        m_layerTreeView->setSurfaceReady();
    352354}
    353355
     
    10131015    webView()->setSpellCheckClient(proxy()->spellCheckClient());
    10141016    webView()->setPrerendererClient(this);
    1015     webView()->setCompositorSurfaceReady();
    10161017}
    10171018
Note: See TracChangeset for help on using the changeset viewer.