Add a comment in order to clarify why
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 4 Jul 2012 05:19:27 +0000 (05:19 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 4 Jul 2012 05:19:27 +0000 (05:19 +0000)
BitmapImage::frameHasAlphaAtIndex returns true as default.
https://bugs.webkit.org/show_bug.cgi?id=90445

Patch by Huang Dongsung <luxtella@company100.net> on 2012-07-03
Reviewed by Eric Seidel.

No new tests. This patch doesn't change behavior.

* platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::frameHasAlphaAtIndex):
(WebCore):

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

Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/BitmapImage.cpp

index 2c92eca..36a5580 100644 (file)
@@ -1,3 +1,17 @@
+2012-07-03  Huang Dongsung  <luxtella@company100.net>
+
+        Add a comment in order to clarify why
+        BitmapImage::frameHasAlphaAtIndex returns true as default.
+        https://bugs.webkit.org/show_bug.cgi?id=90445
+
+        Reviewed by Eric Seidel.
+
+        No new tests. This patch doesn't change behavior.
+
+        * platform/graphics/BitmapImage.cpp:
+        (WebCore::BitmapImage::frameHasAlphaAtIndex):
+        (WebCore):
+
 2012-07-03  Alex Sakhartchouk  <alexst@chromium.org>
 
         [chromium] Avoid calling getUniformLocation??() in the compositor startup
index 8bc9722..2c75404 100644 (file)
@@ -319,8 +319,10 @@ NativeImagePtr BitmapImage::nativeImageForCurrentFrame()
 
 bool BitmapImage::frameHasAlphaAtIndex(size_t index)
 {
+    // When a frame has not finished decoding, always mark it as having alpha.
+    // See ImageSource::framehasAlphaAtIndex for explanation of why incomplete images claim to have alpha.
     if (!ensureFrameIsCached(index))
-        return true; // Why does an invalid index mean alpha?
+        return true;
     return m_frames[index].m_hasAlpha;
 }