Title: [125374] trunk/Source/WebCore
Revision
125374
Author
[email protected]
Date
2012-08-12 05:12:56 -0700 (Sun, 12 Aug 2012)

Log Message

Set the access qualifier of two methods to query frame specific info of BitmapImage to protected.
https://bugs.webkit.org/show_bug.cgi?id=90505

Patch by Huang Dongsung <[email protected]> on 2012-08-12
Reviewed by Eric Seidel.

Following 4 methods are protected.
  size_t frameCount();
  NativeImagePtr frameAtIndex(size_t);
  bool frameIsCompleteAtIndex(size_t);
  float frameDurationAtIndex(size_t);

So, 2 methds also should be protected because the frame info is only specific of
BitmapImage.
  bool frameHasAlphaAtIndex(size_t);
  ImageOrientation frameOrientationAtIndex(size_t);

On the other hand, this patch amended GraphicsContext3DCG.
- static_cast<BitmapImage*>(image)->frameHasAlphaAtIndex(0)
+ image->currentFrameHasAlpha()

This patch does not affect PNG, JPEG, BMP, and WEBP because those images
have only 0 indexed frame.
Thus, GIF, and ICO are affected. However, an above query to get Alpha
is for the image that is created by image->nativeImageForCurrentFrame(), so it
is proper to use image->currentFrameHasAlpha() instead of
image->frameHasAlphaAtIndex(0).

No new tests, because it is hard to test. We need an animated GIF that
one frame has alpha and another frame does not have alpha. However, I
cannot find the animated GIF file that suffices the requirement.

* platform/graphics/BitmapImage.h:
(BitmapImage):
* platform/graphics/cg/GraphicsContext3DCG.cpp:
(WebCore::GraphicsContext3D::getImageData):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (125373 => 125374)


--- trunk/Source/WebCore/ChangeLog	2012-08-12 11:47:34 UTC (rev 125373)
+++ trunk/Source/WebCore/ChangeLog	2012-08-12 12:12:56 UTC (rev 125374)
@@ -1,3 +1,41 @@
+2012-08-12  Huang Dongsung  <[email protected]>
+
+        Set the access qualifier of two methods to query frame specific info of BitmapImage to protected.
+        https://bugs.webkit.org/show_bug.cgi?id=90505
+
+        Reviewed by Eric Seidel.
+
+        Following 4 methods are protected.
+          size_t frameCount();
+          NativeImagePtr frameAtIndex(size_t);
+          bool frameIsCompleteAtIndex(size_t);
+          float frameDurationAtIndex(size_t);
+
+        So, 2 methds also should be protected because the frame info is only specific of
+        BitmapImage.
+          bool frameHasAlphaAtIndex(size_t);
+          ImageOrientation frameOrientationAtIndex(size_t);
+
+        On the other hand, this patch amended GraphicsContext3DCG.
+        - static_cast<BitmapImage*>(image)->frameHasAlphaAtIndex(0)
+        + image->currentFrameHasAlpha()
+
+        This patch does not affect PNG, JPEG, BMP, and WEBP because those images
+        have only 0 indexed frame.
+        Thus, GIF, and ICO are affected. However, an above query to get Alpha
+        is for the image that is created by image->nativeImageForCurrentFrame(), so it
+        is proper to use image->currentFrameHasAlpha() instead of
+        image->frameHasAlphaAtIndex(0).
+
+        No new tests, because it is hard to test. We need an animated GIF that
+        one frame has alpha and another frame does not have alpha. However, I
+        cannot find the animated GIF file that suffices the requirement.
+
+        * platform/graphics/BitmapImage.h:
+        (BitmapImage):
+        * platform/graphics/cg/GraphicsContext3DCG.cpp:
+        (WebCore::GraphicsContext3D::getImageData):
+
 2012-08-12  Takashi Sakamoto  <[email protected]>
 
         webkit fails IETC namespaces/prefix-007.xml

Modified: trunk/Source/WebCore/platform/graphics/BitmapImage.h (125373 => 125374)


--- trunk/Source/WebCore/platform/graphics/BitmapImage.h	2012-08-12 11:47:34 UTC (rev 125373)
+++ trunk/Source/WebCore/platform/graphics/BitmapImage.h	2012-08-12 12:12:56 UTC (rev 125374)
@@ -170,11 +170,9 @@
 #endif
 
     virtual NativeImagePtr nativeImageForCurrentFrame();
-    bool frameHasAlphaAtIndex(size_t);
     virtual bool currentFrameHasAlpha();
 
     ImageOrientation currentFrameOrientation();
-    ImageOrientation frameOrientationAtIndex(size_t);
 
 #if !ASSERT_DISABLED
     virtual bool notSolidColor();
@@ -214,6 +212,8 @@
     NativeImagePtr frameAtIndex(size_t);
     bool frameIsCompleteAtIndex(size_t);
     float frameDurationAtIndex(size_t);
+    bool frameHasAlphaAtIndex(size_t);
+    ImageOrientation frameOrientationAtIndex(size_t);
 
     // Decodes and caches a frame. Never accessed except internally.
     void cacheFrame(size_t index);

Modified: trunk/Source/WebCore/platform/graphics/cg/GraphicsContext3DCG.cpp (125373 => 125374)


--- trunk/Source/WebCore/platform/graphics/cg/GraphicsContext3DCG.cpp	2012-08-12 11:47:34 UTC (rev 125373)
+++ trunk/Source/WebCore/platform/graphics/cg/GraphicsContext3DCG.cpp	2012-08-12 12:12:56 UTC (rev 125374)
@@ -100,7 +100,7 @@
         return false;
     CGImageRef cgImage;
     RetainPtr<CGImageRef> decodedImage;
-    bool hasAlpha = image->isBitmapImage() ? static_cast<BitmapImage*>(image)->frameHasAlphaAtIndex(0) : true;
+    bool hasAlpha = image->isBitmapImage() ? image->currentFrameHasAlpha() : true;
     if ((ignoreGammaAndColorProfile || (hasAlpha && !premultiplyAlpha)) && image->data()) {
         ImageSource decoder(ImageSource::AlphaNotPremultiplied,
                             ignoreGammaAndColorProfile ? ImageSource::GammaAndColorProfileIgnored : ImageSource::GammaAndColorProfileApplied);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to