Changeset 106986 in webkit


Ignore:
Timestamp:
Feb 7, 2012 1:50:57 PM (12 years ago)
Author:
jamesr@google.com
Message:

[chromium] Gracefully handle compositor initialization failure in single-threaded proxy
https://bugs.webkit.org/show_bug.cgi?id=78013

Reviewed by Kenneth Russell.

If compositor initialization fails it's not safe to proceed through the rest of the frame process. This adds
some early outs.

Tested manually by forcing the first makeContextCurrent() call fail.

  • platform/graphics/chromium/cc/CCLayerTreeHost.cpp:

(WebCore::CCLayerTreeHost::updateLayers):

  • platform/graphics/chromium/cc/CCLayerTreeHost.h:

(CCLayerTreeHost):

  • platform/graphics/chromium/cc/CCSingleThreadProxy.cpp:

(WebCore::CCSingleThreadProxy::compositeAndReadback):
(WebCore::CCSingleThreadProxy::compositeImmediately):
(WebCore::CCSingleThreadProxy::commitIfNeeded):

  • platform/graphics/chromium/cc/CCSingleThreadProxy.h:

(CCSingleThreadProxy):

Location:
trunk/Source/WebCore
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r106982 r106986  
     12012-02-07  James Robinson  <jamesr@chromium.org>
     2
     3        [chromium] Gracefully handle compositor initialization failure in single-threaded proxy
     4        https://bugs.webkit.org/show_bug.cgi?id=78013
     5
     6        Reviewed by Kenneth Russell.
     7
     8        If compositor initialization fails it's not safe to proceed through the rest of the frame process. This adds
     9        some early outs.
     10
     11        Tested manually by forcing the first makeContextCurrent() call fail.
     12
     13        * platform/graphics/chromium/cc/CCLayerTreeHost.cpp:
     14        (WebCore::CCLayerTreeHost::updateLayers):
     15        * platform/graphics/chromium/cc/CCLayerTreeHost.h:
     16        (CCLayerTreeHost):
     17        * platform/graphics/chromium/cc/CCSingleThreadProxy.cpp:
     18        (WebCore::CCSingleThreadProxy::compositeAndReadback):
     19        (WebCore::CCSingleThreadProxy::compositeImmediately):
     20        (WebCore::CCSingleThreadProxy::commitIfNeeded):
     21        * platform/graphics/chromium/cc/CCSingleThreadProxy.h:
     22        (CCSingleThreadProxy):
     23
    1242012-02-07  Brady Eidson  <beidson@apple.com>
    225
  • trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp

    r106969 r106986  
    372372}
    373373
    374 void CCLayerTreeHost::updateLayers()
     374bool CCLayerTreeHost::updateLayers()
    375375{
    376376    if (!m_layerRendererInitialized) {
     
    378378        // If we couldn't initialize, then bail since we're returning to software mode.
    379379        if (!m_layerRendererInitialized)
    380             return;
     380            return false;
    381381    }
    382382
    383383    if (!rootLayer())
    384         return;
     384        return true;
    385385
    386386    if (viewportSize().isEmpty())
    387         return;
     387        return true;
    388388
    389389    updateLayers(rootLayer());
     390    return true;
    390391}
    391392
  • trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.h

    r106700 r106986  
    185185    void setHaveWheelEventHandlers(bool);
    186186
    187     void updateLayers();
     187    // Returns false if we should abort this frame due to initialization failure.
     188    bool updateLayers();
    188189
    189190    void updateCompositorResources(GraphicsContext3D*, CCTextureUpdater&);
  • trunk/Source/WebCore/platform/graphics/chromium/cc/CCSingleThreadProxy.cpp

    r106951 r106986  
    7979    }
    8080
    81     commitIfNeeded();
     81    if (!commitIfNeeded())
     82        return false;
    8283
    8384    if (!doComposite())
     
    229230        return;
    230231
    231     commitIfNeeded();
     232    if (!commitIfNeeded())
     233        return;
    232234
    233235    if (doComposite())
     
    283285}
    284286
    285 void CCSingleThreadProxy::commitIfNeeded()
    286 {
    287     ASSERT(CCProxy::isMainThread());
    288 
    289     m_layerTreeHost->updateLayers();
     287bool CCSingleThreadProxy::commitIfNeeded()
     288{
     289    ASSERT(CCProxy::isMainThread());
     290
     291    if (!m_layerTreeHost->updateLayers())
     292        return false;
    290293
    291294    doCommit();
     295    return true;
    292296}
    293297
  • trunk/Source/WebCore/platform/graphics/chromium/cc/CCSingleThreadProxy.h

    r106700 r106986  
    6969    explicit CCSingleThreadProxy(CCLayerTreeHost*);
    7070    bool recreateContextIfNeeded();
    71     void commitIfNeeded();
     71    bool commitIfNeeded();
    7272    void doCommit();
    7373    bool doComposite();
  • trunk/Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.cpp

    r106951 r106986  
    398398    m_commitRequested = false;
    399399
    400     m_layerTreeHost->updateLayers();
     400    if (!m_layerTreeHost->updateLayers())
     401        return;
    401402
    402403    // Before applying scrolls and calling animate, we set m_animateRequested to false.
Note: See TracChangeset for help on using the changeset viewer.