2007-07-05 Alp Toker <alp.toker@collabora.co.uk>
authorbdash <bdash@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 5 Jul 2007 13:43:44 +0000 (13:43 +0000)
committerbdash <bdash@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 5 Jul 2007 13:43:44 +0000 (13:43 +0000)
        Reviewed by Mark Rowe.

        http://bugs.webkit.org/show_bug.cgi?id=14513
        Cairo animated GIF support is broken

        Implement ImageSource::frameIsCompleteAtIndex() to enable animated GIFs.

        * platform/graphics/cairo/ImageSourceCairo.cpp:
        (WebCore::ImageSource::frameIsCompleteAtIndex):

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

WebCore/ChangeLog
WebCore/platform/graphics/cairo/ImageSourceCairo.cpp

index 0b081d2..50ede8f 100644 (file)
@@ -1,3 +1,15 @@
+2007-07-05  Alp Toker  <alp.toker@collabora.co.uk>
+
+        Reviewed by Mark Rowe.
+
+        http://bugs.webkit.org/show_bug.cgi?id=14513
+        Cairo animated GIF support is broken
+
+        Implement ImageSource::frameIsCompleteAtIndex() to enable animated GIFs.
+
+        * platform/graphics/cairo/ImageSourceCairo.cpp:
+        (WebCore::ImageSource::frameIsCompleteAtIndex):
+
 2007-07-04  Matt Perry  <mpComplete@gmail.com>
 
         Reviewed by Adam.
index e357836..213a1e9 100644 (file)
@@ -1,5 +1,6 @@
 /*
  * Copyright (C) 2006 Apple Computer, Inc.  All rights reserved.
+ * Copyright (C) 2007 Alp Toker <alp.toker@collabora.co.uk>
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -163,10 +164,13 @@ NativeImagePtr ImageSource::createFrameAtIndex(size_t index)
                                                size().width()*4);
 }
 
-bool ImageSource::frameIsCompleteAtIndex(size_t)
+bool ImageSource::frameIsCompleteAtIndex(size_t index)
 {
-    // FIXME: write me. Returning false makes the animation not run
-    return false;
+    if (!m_decoder)
+        return false;
+
+    RGBA32Buffer* buffer = m_decoder->frameBufferAtIndex(index);
+    return buffer && buffer->status() == RGBA32Buffer::FrameComplete;
 }
 
 float ImageSource::frameDurationAtIndex(size_t index)