[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.19-706-ge5415e9

simon.fraser at apple.com simon.fraser at apple.com
Thu Feb 4 21:26:11 UTC 2010


The following commit has been merged in the webkit-1.1 branch:
commit cdb52a3d6a4b2c0022b2e52dbe4ddad2b4b97847
Author: simon.fraser at apple.com <simon.fraser at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Sat Jan 23 16:08:39 2010 +0000

    2010-01-22  Simon Fraser  <simon.fraser at apple.com>
    
            Reviewed by Eric Carlson.
    
            Race condition in video setup can force videos into software mode
            https://bugs.webkit.org/show_bug.cgi?id=34034
    
            We used to call setUpVideoRendering() unconditionally from
            acceleratedRenderingStateChanged(); this could happen before the movie had any
            data, and thus force the movie into software rendering mode.
    
            Fix by returning early from setUpVideoRendering() if isReadyForRendering() returns false,
            which also allows us to remove some other checks for being ready to render.
    
            Timing dependent, hard to make a test for.
    
            * platform/graphics/mac/GraphicsLayerCA.mm:
            (WebCore::GraphicsLayerCA::setContentsToMedia): Optimize to do an early return
            if passing in the same layer that is already being used.
    
            * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
            (WebCore::MediaPlayerPrivate::setUpVideoRendering): Return without doing anything
            if not ready to render.
            (WebCore::MediaPlayerPrivate::updateStates): No need to call isReadyForRendering()
            any more, since setUpVideoRendering() does that.
            (WebCore::MediaPlayerPrivate::setVisible): No need to check the ready state; this
            is equivalent to the check inside of setUpVideoRendering().
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@53768 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 04d4bb5..061e0d9 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -276,6 +276,34 @@
 
 2010-01-22  Simon Fraser  <simon.fraser at apple.com>
 
+        Reviewed by Eric Carlson.
+
+        Race condition in video setup can force videos into software mode
+        https://bugs.webkit.org/show_bug.cgi?id=34034
+
+        We used to call setUpVideoRendering() unconditionally from
+        acceleratedRenderingStateChanged(); this could happen before the movie had any
+        data, and thus force the movie into software rendering mode.
+        
+        Fix by returning early from setUpVideoRendering() if isReadyForRendering() returns false,
+        which also allows us to remove some other checks for being ready to render.
+        
+        Timing dependent, hard to make a test for.
+
+        * platform/graphics/mac/GraphicsLayerCA.mm:
+        (WebCore::GraphicsLayerCA::setContentsToMedia): Optimize to do an early return
+        if passing in the same layer that is already being used.
+        
+        * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
+        (WebCore::MediaPlayerPrivate::setUpVideoRendering): Return without doing anything
+        if not ready to render.
+        (WebCore::MediaPlayerPrivate::updateStates): No need to call isReadyForRendering()
+        any more, since setUpVideoRendering() does that.
+        (WebCore::MediaPlayerPrivate::setVisible): No need to check the ready state; this
+        is equivalent to the check inside of setUpVideoRendering().
+
+2010-01-22  Simon Fraser  <simon.fraser at apple.com>
+
         Reviewed by Dan Bernstein.
 
         REGRESSION (r53110): Find My iPhone message dialog is offset from original position once it gets focus
diff --git a/WebCore/platform/graphics/mac/GraphicsLayerCA.mm b/WebCore/platform/graphics/mac/GraphicsLayerCA.mm
index 801f583..a097972 100644
--- a/WebCore/platform/graphics/mac/GraphicsLayerCA.mm
+++ b/WebCore/platform/graphics/mac/GraphicsLayerCA.mm
@@ -794,13 +794,14 @@ void GraphicsLayerCA::setContentsToImage(Image* image)
 
 void GraphicsLayerCA::setContentsToMedia(PlatformLayer* mediaLayer)
 {
-    if (mediaLayer != m_contentsLayer.get())
-        noteSublayersChanged();
+    if (mediaLayer == m_contentsLayer)
+        return;
 
     m_contentsLayer = mediaLayer;
-    noteLayerPropertyChanged(ContentsMediaLayerChanged);
-
     m_contentsLayerPurpose = mediaLayer ? ContentsLayerForMedia : NoContentsLayer;
+
+    noteSublayersChanged();
+    noteLayerPropertyChanged(ContentsMediaLayerChanged);
 }
 
 void GraphicsLayerCA::setGeometryOrientation(CompositingCoordinatesOrientation orientation)
diff --git a/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm b/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm
index 701f779..3c79bf3 100644
--- a/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm
+++ b/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm
@@ -499,6 +499,9 @@ MediaPlayerPrivate::MediaRenderingMode MediaPlayerPrivate::preferredRenderingMod
 
 void MediaPlayerPrivate::setUpVideoRendering()
 {
+    if (!isReadyForRendering())
+        return;
+
     MediaRenderingMode currentMode = currentRenderingMode();
     MediaRenderingMode preferredMode = preferredRenderingMode();
     if (currentMode == preferredMode && currentMode != MediaRenderingNone)
@@ -967,7 +970,7 @@ void MediaPlayerPrivate::updateStates()
         }
     }
 
-    if (isReadyForRendering() && !hasSetUpVideoRendering())
+    if (!hasSetUpVideoRendering())
         setUpVideoRendering();
 
     if (seeking())
@@ -1064,10 +1067,9 @@ void MediaPlayerPrivate::setVisible(bool b)
 {
     if (m_visible != b) {
         m_visible = b;
-        if (b) {
-            if (m_readyState >= MediaPlayer::HaveMetadata)
-                setUpVideoRendering();
-        } else
+        if (b)
+            setUpVideoRendering();
+        else
             tearDownVideoRendering();
     }
 }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list