Commit 00ee54b1 authored by andersca's avatar andersca
Browse files

Get the size from the shared buffer.

        
        * platform/graphics/cg/ImageSourceCG.cpp:
        (WebCore::ImageSource::setData):
        * platform/graphics/cg/PDFDocumentImage.cpp:
        (WebCore::PDFDocumentImage::dataChanged):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@20189 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 760f10f9
2007-03-14 Administrator <acarlsson@apple.com>
Get the size from the shared buffer.
* platform/graphics/cg/ImageSourceCG.cpp:
(WebCore::ImageSource::setData):
* platform/graphics/cg/PDFDocumentImage.cpp:
(WebCore::PDFDocumentImage::dataChanged):
2007-03-14 Mitz Pettel <mitz@webkit.org>
 
Reviewed by Hyatt, thumbs up by Darin.
......
......@@ -83,7 +83,7 @@ void ImageSource::setData(SharedBuffer* data, bool allDataReceived)
#else
// If no NSData is available, then we know SharedBuffer will always just be a vector. That means no secret changes can occur to it behind the
// scenes. We use CFDataCreateWithBytesNoCopy in that case.
CFDataRef cfData = CFDataCreateWithBytesNoCopy(0, reinterpret_cast<const UInt8*>(data->data()), length, kCFAllocatorNull);
CFDataRef cfData = CFDataCreateWithBytesNoCopy(0, reinterpret_cast<const UInt8*>(data->data()), data->size(), kCFAllocatorNull);
#endif
CGImageSourceUpdateData(m_decoder, cfData, allDataReceived);
CFRelease(cfData);
......
......@@ -63,7 +63,7 @@ bool PDFDocumentImage::dataChanged(bool allDataReceived)
#else
// If no NSData is available, then we know SharedBuffer will always just be a vector. That means no secret changes can occur to it behind the
// scenes. We use CFDataCreateWithBytesNoCopy in that case.
CFDataRef data = CFDataCreateWithBytesNoCopy(0, reinterpret_cast<const UInt8*>(m_data->data()), length, kCFAllocatorNull);
CFDataRef data = CFDataCreateWithBytesNoCopy(0, reinterpret_cast<const UInt8*>(m_data->data()), m_data->size(), kCFAllocatorNull);
#endif
CGDataProviderRef dataProvider = CGDataProviderCreateWithCFData(data);
CFRelease(data);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment