[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

vangelis at chromium.org vangelis at chromium.org
Wed Dec 22 13:00:18 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 1cf15bae17277ed886bf67add1f88870d9d7bb26
Author: vangelis at chromium.org <vangelis at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Sep 3 23:24:14 2010 +0000

    2010-09-02  Vangelis Kokkevis  <vangelis at chromium.org>
    
            Reviewed by Darin Fisher.
    
            [chromium] Revert to software compositing if the accelerated
            compositor fails to initialize. If we tried to initialize the compositor
            for this WebView and failed, next time the associated chrome client is
            asked whether it can do accelerated compositing it will return false.
            https://bugs.webkit.org/show_bug.cgi?id=45124
    
            * src/ChromeClientImpl.cpp:
            (WebKit::ChromeClientImpl::allowsAcceleratedCompositing):
            * src/ChromeClientImpl.h:
            * src/WebViewImpl.cpp:
            (WebKit::WebViewImpl::WebViewImpl):
            (WebKit::WebViewImpl::paint):
            (WebKit::WebViewImpl::allowsAcceleratedCompositing):
            (WebKit::WebViewImpl::setIsAcceleratedCompositingActive):
            (WebKit::WebViewImpl::getOnscreenGLES2Context):
            * src/WebViewImpl.h:
    2010-09-02  Vangelis Kokkevis  <vangelis at chromium.org>
    
            Reviewed by Darin Fisher.
    
            [chromium] Gracefully switch over to software compositing if the accelerated
            compositor fails to initialize. LayerRendererChromium::create() will now return 0
            if the GLES2Context passed to it is NULL or the LayerRendererChromium failed to initialize
            hardware rendering.
            https://bugs.webkit.org/show_bug.cgi?id=45124
    
            Tested by forcing the creation of the gles2 context to fail and loading pages that normally trigger
            the compositor.
    
            * platform/graphics/chromium/LayerRendererChromium.cpp:
            (WebCore::LayerRendererChromium::create):
            (WebCore::LayerRendererChromium::LayerRendererChromium):
            (WebCore::LayerRendererChromium::makeContextCurrent):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@66777 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index be7273b..d7c0f09 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,21 @@
+2010-09-02  Vangelis Kokkevis  <vangelis at chromium.org>
+
+        Reviewed by Darin Fisher.
+
+        [chromium] Gracefully switch over to software compositing if the accelerated
+        compositor fails to initialize. LayerRendererChromium::create() will now return 0
+        if the GLES2Context passed to it is NULL or the LayerRendererChromium failed to initialize
+        hardware rendering.
+        https://bugs.webkit.org/show_bug.cgi?id=45124
+        
+        Tested by forcing the creation of the gles2 context to fail and loading pages that normally trigger
+        the compositor.
+
+        * platform/graphics/chromium/LayerRendererChromium.cpp:
+        (WebCore::LayerRendererChromium::create):
+        (WebCore::LayerRendererChromium::LayerRendererChromium):
+        (WebCore::LayerRendererChromium::makeContextCurrent):
+
 2010-09-03  Peter Kasting  <pkasting at google.com>
 
         Reviewed by Simon Fraser.
diff --git a/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp b/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp
index f490970..789298a 100644
--- a/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp
+++ b/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp
@@ -77,7 +77,14 @@ static inline bool compareLayerZ(const LayerChromium* a, const LayerChromium* b)
 
 PassOwnPtr<LayerRendererChromium> LayerRendererChromium::create(PassOwnPtr<GLES2Context> gles2Context)
 {
-    return new LayerRendererChromium(gles2Context);
+    if (!gles2Context)
+        return 0;
+
+    OwnPtr<LayerRendererChromium> layerRenderer(new LayerRendererChromium(gles2Context));
+    if (!layerRenderer->hardwareCompositing())
+        return 0;
+
+    return layerRenderer.release();
 }
 
 LayerRendererChromium::LayerRendererChromium(PassOwnPtr<GLES2Context> gles2Context)
@@ -91,7 +98,7 @@ LayerRendererChromium::LayerRendererChromium(PassOwnPtr<GLES2Context> gles2Conte
     , m_currentShader(0)
     , m_gles2Context(gles2Context)
 {
-    m_hardwareCompositing = (m_gles2Context && initializeSharedObjects());
+    m_hardwareCompositing = initializeSharedObjects();
 }
 
 LayerRendererChromium::~LayerRendererChromium()
diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog
index 3ec6e43..3f240ba 100644
--- a/WebKit/chromium/ChangeLog
+++ b/WebKit/chromium/ChangeLog
@@ -1,3 +1,24 @@
+2010-09-02  Vangelis Kokkevis  <vangelis at chromium.org>
+
+        Reviewed by Darin Fisher.
+
+        [chromium] Revert to software compositing if the accelerated
+        compositor fails to initialize. If we tried to initialize the compositor
+        for this WebView and failed, next time the associated chrome client is
+        asked whether it can do accelerated compositing it will return false.
+        https://bugs.webkit.org/show_bug.cgi?id=45124
+        
+        * src/ChromeClientImpl.cpp:
+        (WebKit::ChromeClientImpl::allowsAcceleratedCompositing):
+        * src/ChromeClientImpl.h:
+        * src/WebViewImpl.cpp:
+        (WebKit::WebViewImpl::WebViewImpl):
+        (WebKit::WebViewImpl::paint):
+        (WebKit::WebViewImpl::allowsAcceleratedCompositing):
+        (WebKit::WebViewImpl::setIsAcceleratedCompositingActive):
+        (WebKit::WebViewImpl::getOnscreenGLES2Context):
+        * src/WebViewImpl.h:
+
 2010-09-03  James Robinson  <jamesr at chromium.org>
 
         [chromium] Add one more include to fix the mac compile.
diff --git a/WebKit/chromium/src/ChromeClientImpl.cpp b/WebKit/chromium/src/ChromeClientImpl.cpp
index 9edee02..8a3eda6 100644
--- a/WebKit/chromium/src/ChromeClientImpl.cpp
+++ b/WebKit/chromium/src/ChromeClientImpl.cpp
@@ -750,6 +750,11 @@ void ChromeClientImpl::scheduleCompositingLayerSync()
 {
     m_webView->setRootLayerNeedsDisplay();
 }
+
+bool ChromeClientImpl::allowsAcceleratedCompositing() const
+{
+    return m_webView->allowsAcceleratedCompositing();
+}
 #endif
 
 WebCore::SharedGraphicsContext3D* ChromeClientImpl::getSharedGraphicsContext3D()
diff --git a/WebKit/chromium/src/ChromeClientImpl.h b/WebKit/chromium/src/ChromeClientImpl.h
index d7b5c86..d16d8f6 100644
--- a/WebKit/chromium/src/ChromeClientImpl.h
+++ b/WebKit/chromium/src/ChromeClientImpl.h
@@ -150,6 +150,9 @@ public:
     // Sets a flag to specify that the view needs to be updated, so we need
     // to do an eager layout before the drawing.
     virtual void scheduleCompositingLayerSync();
+
+    // Returns true if accelerated compositing is supported.
+    virtual bool allowsAcceleratedCompositing() const;
 #endif
 
     virtual WebCore::SharedGraphicsContext3D* getSharedGraphicsContext3D();
diff --git a/WebKit/chromium/src/WebViewImpl.cpp b/WebKit/chromium/src/WebViewImpl.cpp
index 43f7f4b..f63c908 100644
--- a/WebKit/chromium/src/WebViewImpl.cpp
+++ b/WebKit/chromium/src/WebViewImpl.cpp
@@ -265,6 +265,7 @@ WebViewImpl::WebViewImpl(WebViewClient* client, WebDevToolsAgentClient* devTools
 #if USE(ACCELERATED_COMPOSITING)
     , m_layerRenderer(0)
     , m_isAcceleratedCompositingActive(false)
+    , m_compositorCreationFailed(false)
 #endif
 #if ENABLE(INPUT_SPEECH)
     , m_speechInputClient(client)
@@ -969,6 +970,7 @@ void WebViewImpl::paint(WebCanvas* canvas, const WebRect& rect)
         IntRect contentRect = view->visibleContentRect(false);
 
         // Ask the layer compositor to redraw all the layers.
+        ASSERT(m_layerRenderer->hardwareCompositing());
         m_layerRenderer->drawLayers(rect, visibleRect, contentRect, IntPoint(view->scrollX(), view->scrollY()));
     }
 #endif
@@ -2105,6 +2107,11 @@ bool WebViewImpl::tabsToLinks() const
 }
 
 #if USE(ACCELERATED_COMPOSITING)
+bool WebViewImpl::allowsAcceleratedCompositing()
+{
+    return !m_compositorCreationFailed;
+}
+
 void WebViewImpl::setRootGraphicsLayer(WebCore::PlatformLayer* layer)
 {
     setIsAcceleratedCompositingActive(layer ? true : false);
@@ -2119,15 +2126,15 @@ void WebViewImpl::setIsAcceleratedCompositingActive(bool active)
 
     if (active) {
         m_layerRenderer = LayerRendererChromium::create(getOnscreenGLES2Context());
-        if (m_layerRenderer->hardwareCompositing()) {
+        if (m_layerRenderer) {
             m_isAcceleratedCompositingActive = true;
             
             // Force a redraw the entire view so that the compositor gets the entire view,
             // rather than just the currently-dirty subset.
             m_client->didInvalidateRect(IntRect(0, 0, m_size.width, m_size.height));
         } else {
-            m_layerRenderer.clear();
             m_isAcceleratedCompositingActive = false;
+            m_compositorCreationFailed = true;
         }
     } else {
         m_layerRenderer = 0;
@@ -2214,7 +2221,10 @@ void WebViewImpl::setRootLayerNeedsDisplay()
 
 PassOwnPtr<GLES2Context> WebViewImpl::getOnscreenGLES2Context()
 {
-    return GLES2Context::create(GLES2ContextInternal::create(gles2Context(), false));
+    WebGLES2Context* context = gles2Context();
+    if (!context)
+        return 0;
+    return GLES2Context::create(GLES2ContextInternal::create(context, false));
 }
 
 SharedGraphicsContext3D* WebViewImpl::getSharedGraphicsContext3D()
diff --git a/WebKit/chromium/src/WebViewImpl.h b/WebKit/chromium/src/WebViewImpl.h
index 6ce2757..a42099c 100644
--- a/WebKit/chromium/src/WebViewImpl.h
+++ b/WebKit/chromium/src/WebViewImpl.h
@@ -324,6 +324,7 @@ public:
 #if USE(ACCELERATED_COMPOSITING)
     void setRootLayerNeedsDisplay();
     void setRootGraphicsLayer(WebCore::PlatformLayer*);
+    bool allowsAcceleratedCompositing();
 #endif
     // Onscreen contexts display to the screen associated with this view.
     // Offscreen contexts render offscreen but can share resources with the
@@ -512,6 +513,7 @@ private:
 #if USE(ACCELERATED_COMPOSITING)
     OwnPtr<WebCore::LayerRendererChromium> m_layerRenderer;
     bool m_isAcceleratedCompositingActive;
+    bool m_compositorCreationFailed;
 #endif
     static const WebInputEvent* m_currentInputEvent;
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list