Changeset 93681 in webkit


Ignore:
Timestamp:
Aug 23, 2011 6:33:12 PM (13 years ago)
Author:
jamesr@google.com
Message:

[chromium] Need a way to test lost compositor context recovery
https://bugs.webkit.org/show_bug.cgi?id=66820

Reviewed by Kenneth Russell.

Source/WebCore:

Adds support for recreating a context as if it was lost, and fixes
compositeAndReadback() to attempt context recovery.

Test: platform/chromium/compositing/lost-compositor-context.html

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

(WebCore::CCLayerTreeHost::compositeAndReadback):
(WebCore::CCLayerTreeHost::loseCompositorContext):

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

Source/WebKit/chromium:

Adds a testing-only API to simulate a lost compositor context.

  • public/WebView.h:
  • src/WebViewImpl.cpp:

(WebKit::WebViewImpl::loseCompositorContext):

  • src/WebViewImpl.h:

Tools:

Exposes a LayoutTestController interface in chromium to simulate a
lost compositor context.

  • DumpRenderTree/chromium/LayoutTestController.cpp:

(LayoutTestController::LayoutTestController):
(LayoutTestController::loseCompositorContext):

  • DumpRenderTree/chromium/LayoutTestController.h:

LayoutTests:

Adds a simple test for losing the compositor context in a recoverable
way on a composited page. Tests that we recover without crashing and
render the updated content on the next frame.

  • platform/chromium/compositing/lost-compositor-context.html: Added.
Location:
trunk
Files:
3 added
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r93663 r93681  
     12011-08-23  James Robinson  <jamesr@chromium.org>
     2
     3        [chromium] Need a way to test lost compositor context recovery
     4        https://bugs.webkit.org/show_bug.cgi?id=66820
     5
     6        Reviewed by Kenneth Russell.
     7
     8        Adds a simple test for losing the compositor context in a recoverable
     9        way on a composited page. Tests that we recover without crashing and
     10        render the updated content on the next frame.
     11
     12        * platform/chromium/compositing/lost-compositor-context.html: Added.
     13
    1142011-08-23  Adam Barth  <abarth@webkit.org>
    215
  • trunk/Source/WebCore/ChangeLog

    r93680 r93681  
     12011-08-23  James Robinson  <jamesr@chromium.org>
     2
     3        [chromium] Need a way to test lost compositor context recovery
     4        https://bugs.webkit.org/show_bug.cgi?id=66820
     5
     6        Reviewed by Kenneth Russell.
     7
     8        Adds support for recreating a context as if it was lost, and fixes
     9        compositeAndReadback() to attempt context recovery.
     10
     11        Test: platform/chromium/compositing/lost-compositor-context.html
     12
     13        * platform/graphics/chromium/cc/CCLayerTreeHost.cpp:
     14        (WebCore::CCLayerTreeHost::compositeAndReadback):
     15        (WebCore::CCLayerTreeHost::loseCompositorContext):
     16        * platform/graphics/chromium/cc/CCLayerTreeHost.h:
     17
    1182011-08-23  Nat Duca  <nduca@chromium.org>
    219
  • trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp

    r93615 r93681  
    135135    // FIXME: need to implement this.
    136136#else
    137     doComposite();
     137    composite(false);
    138138    m_layerRenderer->getFramebufferPixels(pixels, rect);
    139139#endif
     
    276276}
    277277
     278void CCLayerTreeHost::loseCompositorContext()
     279{
     280    m_recreatingGraphicsContext = true;
     281}
     282
    278283void CCLayerTreeHost::reallocateRenderer()
    279284{
  • trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.h

    r93680 r93681  
    119119#if !USE(THREADED_COMPOSITING)
    120120    void composite(bool finish);
     121
     122    void loseCompositorContext();
     123
    121124    LayerRendererChromium* layerRenderer() const { return m_layerRenderer.get(); }
    122125#endif
  • trunk/Source/WebKit/chromium/ChangeLog

    r93680 r93681  
     12011-08-23  James Robinson  <jamesr@chromium.org>
     2
     3        [chromium] Need a way to test lost compositor context recovery
     4        https://bugs.webkit.org/show_bug.cgi?id=66820
     5
     6        Reviewed by Kenneth Russell.
     7
     8        Adds a testing-only API to simulate a lost compositor context.
     9
     10        * public/WebView.h:
     11        * src/WebViewImpl.cpp:
     12        (WebKit::WebViewImpl::loseCompositorContext):
     13        * src/WebViewImpl.h:
     14
    1152011-08-23  Nat Duca  <nduca@chromium.org>
    216
  • trunk/Source/WebKit/chromium/public/WebView.h

    r93434 r93681  
    391391    virtual void exitFullscreen() = 0;
    392392
     393    // Testing functionality for LayoutTestController -----------------------
     394
     395    // Simulates a compositor lost context.
     396    virtual void loseCompositorContext() = 0;
     397
    393398
    394399protected:
  • trunk/Source/WebKit/chromium/src/WebViewImpl.cpp

    r93680 r93681  
    11871187}
    11881188
     1189void WebViewImpl::loseCompositorContext()
     1190{
     1191#if USE(ACCELERATED_COMPOSITING)
     1192    if (m_layerTreeHost)
     1193        m_layerTreeHost->loseCompositorContext();
     1194#endif
     1195}
     1196
    11891197const WebInputEvent* WebViewImpl::m_currentInputEvent = 0;
    11901198
  • trunk/Source/WebKit/chromium/src/WebViewImpl.h

    r93680 r93681  
    407407#endif
    408408
     409    void loseCompositorContext();
     410
    409411private:
    410412    friend class WebView;  // So WebView::Create can call our constructor
  • trunk/Tools/ChangeLog

    r93658 r93681  
     12011-08-23  James Robinson  <jamesr@chromium.org>
     2
     3        [chromium] Need a way to test lost compositor context recovery
     4        https://bugs.webkit.org/show_bug.cgi?id=66820
     5
     6        Reviewed by Kenneth Russell.
     7
     8        Exposes a LayoutTestController interface in chromium to simulate a
     9        lost compositor context.
     10
     11        * DumpRenderTree/chromium/LayoutTestController.cpp:
     12        (LayoutTestController::LayoutTestController):
     13        (LayoutTestController::loseCompositorContext):
     14        * DumpRenderTree/chromium/LayoutTestController.h:
     15
    1162011-08-23  Dimitri Glazkov  <dglazkov@chromium.org>
    217
  • trunk/Tools/DumpRenderTree/chromium/LayoutTestController.cpp

    r92982 r93681  
    119119    bindMethod("isCommandEnabled", &LayoutTestController::isCommandEnabled);
    120120    bindMethod("layerTreeAsText", &LayoutTestController::layerTreeAsText);
     121    bindMethod("loseCompositorContext", &LayoutTestController::loseCompositorContext);
    121122    bindMethod("markerTextForListItem", &LayoutTestController::markerTextForListItem);
    122123    bindMethod("notifyDone", &LayoutTestController::notifyDone);
     
    17221723}
    17231724
     1725void LayoutTestController::loseCompositorContext(const CppArgumentList&, CppVariant*)
     1726{
     1727    m_shell->webView()->loseCompositorContext();
     1728}
     1729
    17241730void LayoutTestController::markerTextForListItem(const CppArgumentList& args, CppVariant* result)
    17251731{
  • trunk/Tools/DumpRenderTree/chromium/LayoutTestController.h

    r92982 r93681  
    358358
    359359    void layerTreeAsText(const CppArgumentList& args, CppVariant* result);
     360
     361    void loseCompositorContext(const CppArgumentList& args, CppVariant* result);
    360362
    361363    void markerTextForListItem(const CppArgumentList&, CppVariant*);
Note: See TracChangeset for help on using the changeset viewer.