iOS build broke with change to make Mac use PDFKit for PDFDocumentImage

https://bugs.webkit.org/show_bug.cgi?id=120771

Reviewed by Anders Carlsson.

* platform/graphics/cg/PDFDocumentImage.cpp:
(WebCore::PDFDocumentImage::createPDFDocument):
Use the (removed in r155069) PLATFORM(MAC) way of making a CGDataProvider from a SharedBuffer
everywhere; this is what iOS was expecting to use (where I accidentally changed behavior),
and it should also work for Windows, the only other USE(CG) platform.

Since we only createPDFDocument() after all data has been received, I'm not
restoring the comment about the SharedBuffer being secretly written to behind its back.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155138 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 02739806
2013-09-05 Tim Horton <timothy_horton@apple.com>
iOS build broke with change to make Mac use PDFKit for PDFDocumentImage
https://bugs.webkit.org/show_bug.cgi?id=120771
Reviewed by Anders Carlsson.
* platform/graphics/cg/PDFDocumentImage.cpp:
(WebCore::PDFDocumentImage::createPDFDocument):
Use the (removed in r155069) PLATFORM(MAC) way of making a CGDataProvider from a SharedBuffer
everywhere; this is what iOS was expecting to use (where I accidentally changed behavior),
and it should also work for Windows, the only other USE(CG) platform.
Since we only createPDFDocument() after all data has been received, I'm not
restoring the comment about the SharedBuffer being secretly written to behind its back.
2013-09-04 Dean Jackson <dino@apple.com>
Rename supportsContext to probablySupportsContext
......@@ -145,13 +145,8 @@ void PDFDocumentImage::draw(GraphicsContext* context, const FloatRect& dstRect,
#if !USE(PDFKIT_FOR_PDFDOCUMENTIMAGE)
void PDFDocumentImage::createPDFDocument()
{
// Create a CGDataProvider to wrap the SharedBuffer.
// We use the GetBytesAtPosition callback rather than the GetBytePointer one because SharedBuffer
// does not provide a way to lock down the byte pointer and guarantee that it won't move, which
// is a requirement for using the GetBytePointer callback.
CGDataProviderDirectCallbacks providerCallbacks = { 0, 0, 0, sharedBufferGetBytesAtPosition, 0 };
RetainPtr<CGDataProviderRef> dataProvider = adoptCF(CGDataProviderCreateDirect(this->data(), this->data()->size(), &providerCallbacks));
RetainPtr<CFDataRef> data = adoptCF(this->data()->createCFData());
RetainPtr<CGDataProviderRef> dataProvider = adoptCF(CGDataProviderCreateWithCFData(data.get()));
m_document = CGPDFDocumentCreateWithProvider(dataProvider.get());
}
......
Markdown is supported
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