Changeset 20183 in webkit
- Timestamp:
- Mar 14, 2007, 1:49:55 AM (18 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r20182 r20183 1 2007-03-14 David Hyatt <hyatt@apple.com> 2 3 Make sure to use CFDataCreateWithBytesNoCopy where we can. 4 5 Reviewed by andersca 6 7 * platform/graphics/cg/ImageSourceCG.cpp: 8 (WebCore::ImageSource::setData): 9 * platform/graphics/cg/PDFDocumentImage.cpp: 10 (WebCore::PDFDocumentImage::dataChanged): 11 1 12 2007-03-13 David Hyatt <hyatt@apple.com> 2 13 -
trunk/WebCore/platform/graphics/cg/ImageSourceCG.cpp
r20182 r20183 77 77 if (!m_decoder) 78 78 m_decoder = CGImageSourceCreateIncremental(NULL); 79 79 #if PLATFORM(MAC) 80 // On Mac the NSData inside the SharedBuffer can be secretly appended to without the SharedBuffer's knowledge. We use SharedBuffer's ability 81 // to wrap itself in an NSData to get around this, ensuring that ImageIO is really looking at the SharedBuffer. 80 82 CFDataRef cfData = (CFDataRef)data->createNSData(); 83 #else 84 // 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 85 // scenes. We use CFDataCreateWithBytesNoCopy in that case. 86 CFDataRef cfData = CFDataCreateWithBytesNoCopy(0, reinterpret_cast<const UInt8*>(data->data()), length, kCFAllocatorNull); 87 #endif 81 88 CGImageSourceUpdateData(m_decoder, cfData, allDataReceived); 82 89 CFRelease(cfData); -
trunk/WebCore/platform/graphics/cg/PDFDocumentImage.cpp
r20182 r20183 57 57 { 58 58 if (allDataReceived && !m_document) { 59 #if PLATFORM(MAC) 60 // On Mac the NSData inside the SharedBuffer can be secretly appended to without the SharedBuffer's knowledge. We use SharedBuffer's ability 61 // to wrap itself in an NSData to get around this, ensuring that ImageIO is really looking at the SharedBuffer. 59 62 CFDataRef data = (CFDataRef)m_data->createNSData(); 63 #else 64 // 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 65 // scenes. We use CFDataCreateWithBytesNoCopy in that case. 66 CFDataRef data = CFDataCreateWithBytesNoCopy(0, reinterpret_cast<const UInt8*>(m_data->data()), length, kCFAllocatorNull); 67 #endif 60 68 CGDataProviderRef dataProvider = CGDataProviderCreateWithCFData(data); 61 69 CFRelease(data);
Note:
See TracChangeset
for help on using the changeset viewer.