2008-08-19 Eric Carlson <eric.carlson@apple.com>
authoradele@apple.com <adele@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 19 Aug 2008 17:55:58 +0000 (17:55 +0000)
committeradele@apple.com <adele@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 19 Aug 2008 17:55:58 +0000 (17:55 +0000)
        Reviewed by Adele.

        Fix for <rdar://problem/6154695> Full-page movies flicker while playing
        https://bugs.webkit.org/show_bug.cgi?id=20404

        Ignore setVisible() when visibility doesn't change.

        * platform/graphics/mac/MediaPlayerPrivateQTKit.h:
        * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
        (WebCore::MediaPlayerPrivate::MediaPlayerPrivate):
        (WebCore::MediaPlayerPrivate::setVisible):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@35840 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.h
WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm

index c539146..fa64c9e 100644 (file)
@@ -1,3 +1,17 @@
+2008-08-19  Eric Carlson  <eric.carlson@apple.com>
+
+        Reviewed by Adele.
+
+        Fix for <rdar://problem/6154695> Full-page movies flicker while playing
+        https://bugs.webkit.org/show_bug.cgi?id=20404
+
+        Ignore setVisible() when visibility doesn't change.
+
+        * platform/graphics/mac/MediaPlayerPrivateQTKit.h:
+        * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
+        (WebCore::MediaPlayerPrivate::MediaPlayerPrivate):
+        (WebCore::MediaPlayerPrivate::setVisible):
+
 2008-08-19  Timothy Hatcher  <timothy@apple.com>
 
         Fixes a bug in the Profile view where switching sort order, then
index 0fe6837..3f18ab4 100644 (file)
@@ -135,6 +135,7 @@ private:
     MediaPlayer::ReadyState m_readyState;
     bool m_startedPlaying;
     bool m_isStreaming;
+    bool m_visible;
 #if DRAW_FRAME_RATE
     int  m_frameCountWhilePlaying;
     double m_timeStartedPlaying;
index 9542dd8..0ec56d6 100644 (file)
@@ -167,6 +167,7 @@ MediaPlayerPrivate::MediaPlayerPrivate(MediaPlayer* player)
     , m_readyState(MediaPlayer::DataUnavailable)
     , m_startedPlaying(false)
     , m_isStreaming(false)
+    , m_visible(false)
 #if DRAW_FRAME_RATE
     , m_frameCountWhilePlaying(0)
     , m_timeStartedPlaying(0)
@@ -731,12 +732,14 @@ void MediaPlayerPrivate::setRect(const IntRect& r)
 
 void MediaPlayerPrivate::setVisible(bool b)
 {
-    // MediaPlayer invokes this method only when the visibility state is changing
-    if (b) {
-        if (m_networkState >= MediaPlayer::LoadedMetaData)
-            setUpVideoRendering();
-    } else
-        tearDownVideoRendering();
+    if (m_visible != b) {
+        m_visible = b;
+        if (b) {
+            if (m_networkState >= MediaPlayer::LoadedMetaData)
+                setUpVideoRendering();
+        } else
+            tearDownVideoRendering();
+    }
 }
 
 void MediaPlayerPrivate::repaint()