Changeset 150340 in webkit


Ignore:
Timestamp:
May 18, 2013, 12:09:07 PM (12 years ago)
Author:
Simon Fraser
Message:

Garbage on page background while http://canberraballoons.com.au is loading
https://bugs.webkit.org/show_bug.cgi?id=116384
<rdar://problem/13930328>

Reviewed by Dan Bernstein.

This page loads a large JPEG image as the body background.
ImageSource::frameHasAlphaAtIndex() always claims that JPEG images
are opaque, but this isn't true if the frame is only partially loaded.
However, this would cause FillLayer::hasOpaqueImage() to report that the
background image is opaque, so we'd skip painting the background color.
Unpainted content in an opaque layer results in garbage.

Fix by having ImageSource::frameHasAlphaAtIndex() always return true
for frames that are not complete. When the image load completes, we
recompute metadata and correctly determine that the frame is opaque.

  • platform/graphics/cg/ImageSourceCG.cpp:

(WebCore::ImageSource::frameHasAlphaAtIndex):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified trunk/Source/WebCore/ChangeLog

    r150339 r150340  
     12013-05-17  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Garbage on page background while http://canberraballoons.com.au is loading
     4        https://bugs.webkit.org/show_bug.cgi?id=116384
     5        <rdar://problem/13930328>
     6
     7        Reviewed by Dan Bernstein.
     8
     9        This page loads a large JPEG image as the body background.
     10        ImageSource::frameHasAlphaAtIndex() always claims that JPEG images
     11        are opaque, but this isn't true if the frame is only partially loaded.
     12        However, this would cause FillLayer::hasOpaqueImage() to report that the
     13        background image is opaque, so we'd skip painting the background color.
     14        Unpainted content in an opaque layer results in garbage.
     15       
     16        Fix by having ImageSource::frameHasAlphaAtIndex() always return true
     17        for frames that are not complete. When the image load completes, we
     18        recompute metadata and correctly determine that the frame is opaque.
     19
     20        * platform/graphics/cg/ImageSourceCG.cpp:
     21        (WebCore::ImageSource::frameHasAlphaAtIndex):
     22
    1232013-05-18  Timothy Hatcher  <timothy@apple.com>
    224
  • TabularUnified trunk/Source/WebCore/platform/graphics/cg/ImageSourceCG.cpp

    r149980 r150340  
    362362}
    363363
    364 bool ImageSource::frameHasAlphaAtIndex(size_t)
     364bool ImageSource::frameHasAlphaAtIndex(size_t index)
    365365{
    366366    if (!m_decoder)
    367         return false;
     367        return false; // FIXME: why doesn't this return true?
     368
     369    if (!frameIsCompleteAtIndex(index))
     370        return true;
    368371
    369372    CFStringRef imageType = CGImageSourceGetType(m_decoder);
Note: See TracChangeset for help on using the changeset viewer.