Changeset 70543 in webkit


Ignore:
Timestamp:
Oct 26, 2010 11:18:44 AM (14 years ago)
Author:
commit-queue@webkit.org
Message:

2010-10-26 Alexey Marinichev <amarinichev@chromium.org>

Reviewed by Kenneth Russell.

[chromium] Check getGraphicsResetStatusARB and reinitialize the
renderer in an error is returned.
https://bugs.webkit.org/show_bug.cgi?id=47848

Tested by failure injection (stopping in the debugger and issuing a
jump as if an error has occurred).

  • platform/graphics/chromium/LayerChromium.cpp: (WebCore::LayerChromium::setLayerRenderer):
  • platform/graphics/chromium/LayerRendererChromium.h: (WebCore::LayerRendererChromium::transferRootLayer): added

2010-10-26 Alexey Marinichev <amarinichev@chromium.org>

Reviewed by Kenneth Russell.

[chromium] Check getGraphicsResetStatusARB and reinitialize the
renderer in an error is returned.
https://bugs.webkit.org/show_bug.cgi?id=47848

  • src/WebViewImpl.cpp: (WebKit::WebViewImpl::composite): added getGraphicsResetStatusARB check (WebKit::WebViewImpl::reallocateRenderer): added
  • src/WebViewImpl.h:
Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r70535 r70543  
     12010-10-26  Alexey Marinichev  <amarinichev@chromium.org>
     2
     3        Reviewed by Kenneth Russell.
     4
     5        [chromium] Check getGraphicsResetStatusARB and reinitialize the
     6        renderer in an error is returned.
     7        https://bugs.webkit.org/show_bug.cgi?id=47848
     8
     9        Tested by failure injection (stopping in the debugger and issuing a
     10        jump as if an error has occurred).
     11
     12        * platform/graphics/chromium/LayerChromium.cpp:
     13        (WebCore::LayerChromium::setLayerRenderer):
     14        * platform/graphics/chromium/LayerRendererChromium.h:
     15        (WebCore::LayerRendererChromium::transferRootLayer): added
     16
    1172010-10-26  Pavel Feldman  <pfeldman@chromium.org>
    218
  • trunk/WebCore/platform/graphics/chromium/LayerChromium.cpp

    r70010 r70543  
    177177    // If we're changing layer renderers then we need to free up any resources
    178178    // allocated by the old renderer.
    179     if (layerRenderer() && layerRenderer() != renderer)
     179    if (layerRenderer() && layerRenderer() != renderer) {
    180180        cleanupResources();
     181        setNeedsDisplay();
     182    }
    181183
    182184    m_layerRenderer = renderer;
  • trunk/WebCore/platform/graphics/chromium/LayerRendererChromium.h

    r70010 r70543  
    8383    void setRootLayer(PassRefPtr<LayerChromium> layer) { m_rootLayer = layer; }
    8484    LayerChromium* rootLayer() { return m_rootLayer.get(); }
     85    void transferRootLayer(LayerRendererChromium* other) { other->m_rootLayer = m_rootLayer.release(); }
    8586
    8687    bool hardwareCompositing() const { return m_hardwareCompositing; }
  • trunk/WebKit/chromium/ChangeLog

    r70534 r70543  
     12010-10-26  Alexey Marinichev  <amarinichev@chromium.org>
     2
     3        Reviewed by Kenneth Russell.
     4
     5        [chromium] Check getGraphicsResetStatusARB and reinitialize the
     6        renderer in an error is returned.
     7        https://bugs.webkit.org/show_bug.cgi?id=47848
     8
     9        * src/WebViewImpl.cpp:
     10        (WebKit::WebViewImpl::composite): added getGraphicsResetStatusARB check
     11        (WebKit::WebViewImpl::reallocateRenderer): added
     12        * src/WebViewImpl.h:
     13
    1142010-10-26  Kenneth Russell  <kbr@google.com>
    215
  • trunk/WebKit/chromium/src/WebViewImpl.cpp

    r70302 r70543  
    10471047    // Put result onscreen.
    10481048    m_layerRenderer->present();
     1049
     1050    GraphicsContext3D* context = m_layerRenderer->context();
     1051    if (context->getGraphicsResetStatusARB() != GraphicsContext3D::NO_ERROR)
     1052        reallocateRenderer();
    10491053#endif
    10501054}
     
    24892493    m_layerRenderer->drawLayers(visibleRect, contentRect);
    24902494}
     2495
     2496void WebViewImpl::reallocateRenderer()
     2497{
     2498    GraphicsContext3D* context = m_layerRenderer->context();
     2499    RefPtr<GraphicsContext3D> newContext = GraphicsContext3D::create(context->getContextAttributes(), m_page->chrome(), GraphicsContext3D::RenderDirectlyToHostWindow);
     2500    // GraphicsContext3D::create might fail and return 0, in that case LayerRendererChromium::create will also return 0.
     2501    RefPtr<LayerRendererChromium> layerRenderer = LayerRendererChromium::create(newContext);
     2502
     2503    // Reattach the root layer.  Child layers will get reattached as a side effect of updateLayersRecursive.
     2504    if (layerRenderer)
     2505        m_layerRenderer->transferRootLayer(layerRenderer.get());
     2506    m_layerRenderer = layerRenderer;
     2507
     2508    // Enable or disable accelerated compositing and request a refresh.
     2509    setRootGraphicsLayer(m_layerRenderer ? m_layerRenderer->rootLayer() : 0);
     2510}
    24912511#endif
    24922512
  • trunk/WebKit/chromium/src/WebViewImpl.h

    r70302 r70543  
    411411    void doComposite();
    412412    void doPixelReadbackToCanvas(WebCanvas*, const WebCore::IntRect&);
     413    void reallocateRenderer();
    413414#endif
    414415
Note: See TracChangeset for help on using the changeset viewer.