[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.20-204-g221d8e8

cmarrin at apple.com cmarrin at apple.com
Wed Feb 10 22:17:33 UTC 2010


The following commit has been merged in the webkit-1.1 branch:
commit 7dd795a3e5e7984be920e531b6a22b7e3ebaa337
Author: cmarrin at apple.com <cmarrin at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Sat Feb 6 01:10:58 2010 +0000

            Fixed changed virtual function in GraphicsLayerCACF and call order issues
            https://bugs.webkit.org/show_bug.cgi?id=34348
    
            The correct virtual function in GraphicsLayerCACF is now being
            called. We also fixed an issue in QTMovieWin where the size
            of the movie was not being set correctly because the call order
            was changed.
    
            I also changed the order of a couple of calls in QTMovieWin to account
            for changed calling order from the logic above.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@54455 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 8f7b9c0..d98955d 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,29 @@
+2010-02-05  Chris Marrin  <cmarrin at apple.com>
+
+        Reviewed by Simon Fraser.
+
+        Fixed changed virtual function in GraphicsLayerCACF and call order issues
+        https://bugs.webkit.org/show_bug.cgi?id=34348
+        
+        The correct virtual function in GraphicsLayerCACF is now being
+        called. We also fixed an issue in QTMovieWin where the size
+        of the movie was not being set correctly because the call order
+        was changed.
+        
+        I also changed the order of a couple of calls in QTMovieWin to account
+        for changed calling order from the logic above.
+
+        * platform/graphics/win/GraphicsLayerCACF.cpp:Update to new virtual function API
+        (WebCore::GraphicsLayerCACF::setContentsToMedia):
+        (WebCore::GraphicsLayerCACF::updateContentsMedia):
+        * platform/graphics/win/GraphicsLayerCACF.h:Update to new virtual function API
+        (WebCore::GraphicsLayerCACF::):
+        * platform/graphics/win/QTMovieWin.cpp:
+        (QTMovieWinPrivate::cacheMovieScale):Fix a bug where ratio was computed wrong because it was using integer math
+        (QTMovieWinPrivate::task):Compute movie scale before computing movie size so values are correct
+        (QTMovieWinPrivate::setSize):Move movie size update to updateMovieSize()
+        (QTMovieWinPrivate::updateMovieSize):Wrap size update in a new call so it can be used from multiple places
+
 2010-02-05  Enrica Casucci  <enrica at apple.com>
 
         Reviewed by Simon Fraser.
diff --git a/WebCore/platform/graphics/win/GraphicsLayerCACF.cpp b/WebCore/platform/graphics/win/GraphicsLayerCACF.cpp
index 5ec90b8..ca7e496 100644
--- a/WebCore/platform/graphics/win/GraphicsLayerCACF.cpp
+++ b/WebCore/platform/graphics/win/GraphicsLayerCACF.cpp
@@ -364,21 +364,18 @@ void GraphicsLayerCACF::setContentsToImage(Image* image)
         updateSublayerList();
 }
 
-void GraphicsLayerCACF::setContentsToVideo(PlatformLayer* videoLayer)
+void GraphicsLayerCACF::setContentsToMedia(PlatformLayer* mediaLayer)
 {
-    bool childrenChanged = false;
-
-    if (videoLayer != m_contentsLayer.get())
-        childrenChanged = true;
+    if (mediaLayer == m_contentsLayer)
+        return;
 
-    m_contentsLayer = videoLayer;
-    m_contentsLayerPurpose = videoLayer ? ContentsLayerForVideo : NoContentsLayer;
+    m_contentsLayer = mediaLayer;
+    m_contentsLayerPurpose = mediaLayer ? ContentsLayerForMedia : NoContentsLayer;
 
-    updateContentsVideo();
+    updateContentsMedia();
 
-    // This has to happen after updateContentsVideo
-    if (childrenChanged)
-        updateSublayerList();
+    // This has to happen after updateContentsMedia
+    updateSublayerList();
 }
 
 void GraphicsLayerCACF::setGeometryOrientation(CompositingCoordinatesOrientation orientation)
@@ -633,9 +630,9 @@ void GraphicsLayerCACF::updateContentsImage()
     }
 }
 
-void GraphicsLayerCACF::updateContentsVideo()
+void GraphicsLayerCACF::updateContentsMedia()
 {
-    // Video layer was set as m_contentsLayer, and will get parented in updateSublayerList().
+    // Media layer was set as m_contentsLayer, and will get parented in updateSublayerList().
     if (m_contentsLayer) {
         setupContentsLayer(m_contentsLayer.get());
         updateContentsRect();
diff --git a/WebCore/platform/graphics/win/GraphicsLayerCACF.h b/WebCore/platform/graphics/win/GraphicsLayerCACF.h
index 93ddf25..0a52764 100644
--- a/WebCore/platform/graphics/win/GraphicsLayerCACF.h
+++ b/WebCore/platform/graphics/win/GraphicsLayerCACF.h
@@ -82,7 +82,7 @@ public:
     virtual void setContentsRect(const IntRect&);
 
     virtual void setContentsToImage(Image*);
-    virtual void setContentsToVideo(PlatformLayer*);
+    virtual void setContentsToMedia(PlatformLayer*);
     
     virtual PlatformLayer* platformLayer() const;
 
@@ -115,7 +115,7 @@ private:
     void updateLayerBackgroundColor();
 
     void updateContentsImage();
-    void updateContentsVideo();
+    void updateContentsMedia();
     void updateContentsRect();
     void updateGeometryOrientation();
     
@@ -129,7 +129,7 @@ private:
     enum ContentsLayerPurpose {
         NoContentsLayer = 0,
         ContentsLayerForImage,
-        ContentsLayerForVideo
+        ContentsLayerForMedia
     };
     
     ContentsLayerPurpose m_contentsLayerPurpose;
diff --git a/WebCore/platform/graphics/win/QTMovieWin.cpp b/WebCore/platform/graphics/win/QTMovieWin.cpp
index 8fd6c71..4831062 100644
--- a/WebCore/platform/graphics/win/QTMovieWin.cpp
+++ b/WebCore/platform/graphics/win/QTMovieWin.cpp
@@ -99,6 +99,7 @@ public:
     void deleteGWorld();
     void clearGWorld();
     void cacheMovieScale();
+    void updateMovieSize();
 
     void setSize(int, int);
 
@@ -226,8 +227,8 @@ void QTMovieWinPrivate::cacheMovieScale()
     GetMovieNaturalBoundsRect(m_movie, &naturalRect);
     GetMovieBox(m_movie, &initialRect);
 
-    int naturalWidth = naturalRect.right - naturalRect.left;
-    int naturalHeight = naturalRect.bottom - naturalRect.top;
+    float naturalWidth = naturalRect.right - naturalRect.left;
+    float naturalHeight = naturalRect.bottom - naturalRect.top;
 
     if (naturalWidth)
         m_widthScaleFactor = (initialRect.right - initialRect.left) / naturalWidth;
@@ -259,14 +260,16 @@ void QTMovieWinPrivate::task()
             // we only need to erase the movie gworld when the load state changes to loaded while it
             //  is visible as the gworld is destroyed/created when visibility changes
             bool shouldRestorePlaybackState = false;
-            if (loadState >= QTMovieLoadStateLoaded && m_loadState < QTMovieLoadStateLoaded) {
+            bool movieNewlyPlayable = loadState >= QTMovieLoadStateLoaded && m_loadState < QTMovieLoadStateLoaded;
+            m_loadState = loadState;
+            if (movieNewlyPlayable) {
+                cacheMovieScale();
+                updateMovieSize();
                 if (m_visible)
                     clearGWorld();
-                cacheMovieScale();
                 shouldRestorePlaybackState = true;
             }
 
-            m_loadState = loadState;
             if (!m_movieController && m_loadState >= QTMovieLoadStateLoaded)
                 createMovieController();
             m_client->movieLoadStateChanged(m_movieWin);
@@ -403,7 +406,6 @@ void QTMovieWinPrivate::clearGWorld()
     MacSetPort(savePort);
 }
 
-
 void QTMovieWinPrivate::setSize(int width, int height)
 {
     if (m_width == width && m_height == height)
@@ -421,17 +423,26 @@ void QTMovieWinPrivate::setSize(int width, int height)
     ASSERT(m_scaleCached);
 #endif
 
+    updateMovieSize();
+}
+
+void QTMovieWinPrivate::updateMovieSize()
+{
+    if (!m_movie || m_loadState < QTMovieLoadStateLoaded)
+        return;
+
     Rect bounds; 
     bounds.top = 0;
     bounds.left = 0; 
-    bounds.right = width;
-    bounds.bottom = height;
+    bounds.right = m_width;
+    bounds.bottom = m_height;
     if (m_movieController)
         MCSetControllerBoundsRect(m_movieController, &bounds);
     SetMovieBox(m_movie, &bounds);
     updateGWorld();
 }
 
+
 void QTMovieWinPrivate::deleteGWorld()
 {
     ASSERT(m_gWorld);

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list