Changeset 57969 in webkit


Ignore:
Timestamp:
Apr 21, 2010 5:22:57 AM (14 years ago)
Author:
eric@webkit.org
Message:

2010-04-21 Avi Drissman <avi@chromium.org>

Reviewed by Simon Fraser.

JPG images fail to print in Chromium
https://bugs.webkit.org/show_bug.cgi?id=37796

Image sources of JPG data with final=false fail to draw into PDF contexts even if later updated (<rdar://problem/7874035>). Therefore, destroy and re-create the image source when the final data arrives.

  • platform/graphics/cg/ImageSourceCG.cpp: (WebCore::ImageSource::setData):
Location:
trunk/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r57967 r57969  
     12010-04-21  Avi Drissman  <avi@chromium.org>
     2
     3        Reviewed by Simon Fraser.
     4
     5        JPG images fail to print in Chromium
     6        https://bugs.webkit.org/show_bug.cgi?id=37796
     7
     8        Image sources of JPG data with final=false fail to draw into PDF contexts even if later updated (<rdar://problem/7874035>). Therefore, destroy and re-create the image source when the final data arrives.
     9
     10        * platform/graphics/cg/ImageSourceCG.cpp:
     11        (WebCore::ImageSource::setData):
     12
    1132010-04-21  Marcus Bulach  <bulach@chromium.org>
    214
  • trunk/WebCore/platform/graphics/cg/ImageSourceCG.cpp

    r55169 r57969  
    120120void ImageSource::setData(SharedBuffer* data, bool allDataReceived)
    121121{
     122#if PLATFORM(MAC)
    122123    if (!m_decoder)
    123         m_decoder = CGImageSourceCreateIncremental(NULL);
    124 #if PLATFORM(MAC)
     124        m_decoder = CGImageSourceCreateIncremental(0);
    125125    // On Mac the NSData inside the SharedBuffer can be secretly appended to without the SharedBuffer's knowledge.  We use SharedBuffer's ability
    126126    // to wrap itself inside CFData to get around this, ensuring that ImageIO is really looking at the SharedBuffer.
     
    128128    CGImageSourceUpdateData(m_decoder, cfData.get(), allDataReceived);
    129129#else
     130    if (!m_decoder) {
     131        m_decoder = CGImageSourceCreateIncremental(0);
     132    } else if (allDataReceived) {
     133        // 10.6 bug workaround: image sources with final=false fail to draw into PDF contexts, so re-create image source
     134        // when data is complete. <rdar://problem/7874035> (<http://openradar.appspot.com/7874035>)
     135        CFRelease(m_decoder);
     136        m_decoder = CGImageSourceCreateIncremental(0);
     137    }
    130138    // Create a CGDataProvider to wrap the SharedBuffer.
    131139    data->ref();
Note: See TracChangeset for help on using the changeset viewer.