Changeset 133935 in webkit


Ignore:
Timestamp:
Nov 8, 2012, 12:47:34 PM (12 years ago)
Author:
timothy_horton@apple.com
Message:

[WK2] Print preview should vend images to the UIProcess instead of PDFs
https://bugs.webkit.org/show_bug.cgi?id=101382
<rdar://problem/9866766>

Reviewed by Alexey Proskuryakov.

In the interests of keeping PDF processing inside the WebProcess, we should
remove print preview's reliance on PDFs, by handing bitmaps back instead.

  • Shared/ShareableBitmap.cpp:

(WebKit::ShareableBitmap::create): Add an optional SharedMemory::Protection argument, so we can make
ShareableBitmaps from read-only handles if desired. Defaults to read-write as previously.
(WebKit::ShareableBitmap::createHandle): Add an optional SharedMemory::Protection argument, so we can make
read-only handles if desired. Defaults to read-write as previously.

  • Shared/ShareableBitmap.h:
  • UIProcess/API/mac/WKPrintingView.h:

(WebImage): Store WebImages instead of raw PDF data for previews.

  • UIProcess/API/mac/WKPrintingView.mm:

(pageDidDrawToImage): Add a callback for when a preview we've requested is done rendering into an image.
Cache the image in _pagePreviews if appropriate.
(pageDidDrawToPDF): Do not handle PDF data unless we are expecting a real print callback (not a preview).
(-[WKPrintingView _drawPreview:]): Request an image instead of PDF data when doing a print preview.

  • UIProcess/GenericCallback.h:

(ImageCallback): Add a callback type with one argument: a ShareableBitmap::Handle.
I can't use the GenericCallback template because ShareableBitmap::Handle doesn't have a corresponding WK type.

  • UIProcess/WebPageProxy.cpp:

(WebKit::WebPageProxy::close): Add support for ImageCallback.
(WebKit::WebPageProxy::imageCallback): Add support for ImageCallback.
(WebKit::WebPageProxy::drawRectToImage): Rename drawRectToPDF to drawRectToImage.

  • UIProcess/WebPageProxy.h:

(WebPageProxy): Rename drawRectToPDF to drawRectToImage, add support for ImageCallback.

  • UIProcess/WebPageProxy.messages.in: Add support for ImageCallback.
  • WebProcess/WebPage/WebPage.cpp:

(WebKit::WebPage::drawRectToImage): Rename drawRectToPDF to drawRectToImage.
Make drawRectToImage create a bitmap snapshot of the page (using the normal snapshotting code),
or, if the page is backed by a *PDFPlugin, draw the PDF document into a bitmap and use that.

  • WebProcess/WebPage/WebPage.h:

(WebPage): Rename drawRectToPDF to drawRectToImage.

  • WebProcess/WebPage/WebPage.messages.in: Rename drawRectToPDF to drawRectToImage.
  • WebProcess/WebPage/mac/WebPageMac.mm:

(WebKit::WebPage::drawPDFDocument): Rename drawRectToPDFFromPDFDocument to drawPDFDocument,
because it's more like drawImage than anything else.

Location:
trunk/Source/WebKit2
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r133890 r133935  
     12012-11-08  Tim Horton  <timothy_horton@apple.com>
     2
     3        [WK2] Print preview should vend images to the UIProcess instead of PDFs
     4        https://bugs.webkit.org/show_bug.cgi?id=101382
     5        <rdar://problem/9866766>
     6
     7        Reviewed by Alexey Proskuryakov.
     8
     9        In the interests of keeping PDF processing inside the WebProcess, we should
     10        remove print preview's reliance on PDFs, by handing bitmaps back instead.
     11
     12        * Shared/ShareableBitmap.cpp:
     13        (WebKit::ShareableBitmap::create): Add an optional SharedMemory::Protection argument, so we can make
     14        ShareableBitmaps from read-only handles if desired. Defaults to read-write as previously.
     15        (WebKit::ShareableBitmap::createHandle): Add an optional SharedMemory::Protection argument, so we can make
     16        read-only handles if desired. Defaults to read-write as previously.
     17        * Shared/ShareableBitmap.h:
     18        * UIProcess/API/mac/WKPrintingView.h:
     19        (WebImage): Store WebImages instead of raw PDF data for previews.
     20        * UIProcess/API/mac/WKPrintingView.mm:
     21        (pageDidDrawToImage): Add a callback for when a preview we've requested is done rendering into an image.
     22        Cache the image in _pagePreviews if appropriate.
     23        (pageDidDrawToPDF): Do not handle PDF data unless we are expecting a real print callback (not a preview).
     24        (-[WKPrintingView _drawPreview:]): Request an image instead of PDF data when doing a print preview.
     25        * UIProcess/GenericCallback.h:
     26        (ImageCallback): Add a callback type with one argument: a ShareableBitmap::Handle.
     27        I can't use the GenericCallback template because ShareableBitmap::Handle doesn't have a corresponding WK type.
     28        * UIProcess/WebPageProxy.cpp:
     29        (WebKit::WebPageProxy::close): Add support for ImageCallback.
     30        (WebKit::WebPageProxy::imageCallback): Add support for ImageCallback.
     31        (WebKit::WebPageProxy::drawRectToImage): Rename drawRectToPDF to drawRectToImage.
     32        * UIProcess/WebPageProxy.h:
     33        (WebPageProxy): Rename drawRectToPDF to drawRectToImage, add support for ImageCallback.
     34        * UIProcess/WebPageProxy.messages.in: Add support for ImageCallback.
     35        * WebProcess/WebPage/WebPage.cpp:
     36        (WebKit::WebPage::drawRectToImage): Rename drawRectToPDF to drawRectToImage.
     37        Make drawRectToImage create a bitmap snapshot of the page (using the normal snapshotting code),
     38        or, if the page is backed by a *PDFPlugin, draw the PDF document into a bitmap and use that.
     39        * WebProcess/WebPage/WebPage.h:
     40        (WebPage): Rename drawRectToPDF to drawRectToImage.
     41        * WebProcess/WebPage/WebPage.messages.in: Rename drawRectToPDF to drawRectToImage.
     42        * WebProcess/WebPage/mac/WebPageMac.mm:
     43        (WebKit::WebPage::drawPDFDocument): Rename drawRectToPDFFromPDFDocument to drawPDFDocument,
     44        because it's more like drawImage than anything else.
     45
    1462012-11-08  Simon Hausmann  <simon.hausmann@digia.com>
    247
  • trunk/Source/WebKit2/Shared/ShareableBitmap.cpp

    r132926 r133935  
    9090}
    9191
    92 PassRefPtr<ShareableBitmap> ShareableBitmap::create(const Handle& handle)
     92PassRefPtr<ShareableBitmap> ShareableBitmap::create(const Handle& handle, SharedMemory::Protection protection)
    9393{
    9494    // Create the shared memory.
    95     RefPtr<SharedMemory> sharedMemory = SharedMemory::create(handle.m_handle, SharedMemory::ReadWrite);
     95    RefPtr<SharedMemory> sharedMemory = SharedMemory::create(handle.m_handle, protection);
    9696    if (!sharedMemory)
    9797        return 0;
     
    100100}
    101101
    102 bool ShareableBitmap::createHandle(Handle& handle)
     102bool ShareableBitmap::createHandle(Handle& handle, SharedMemory::Protection protection)
    103103{
    104104    ASSERT(isBackedBySharedMemory());
    105105
    106     if (!m_sharedMemory->createHandle(handle.m_handle, SharedMemory::ReadWrite))
     106    if (!m_sharedMemory->createHandle(handle.m_handle, protection))
    107107        return false;
    108108    handle.m_size = m_size;
  • trunk/Source/WebKit2/Shared/ShareableBitmap.h

    r132361 r133935  
    9494
    9595    // Create a shareable bitmap from a handle.
    96     static PassRefPtr<ShareableBitmap> create(const Handle&);
     96    static PassRefPtr<ShareableBitmap> create(const Handle&, SharedMemory::Protection = SharedMemory::ReadWrite);
    9797
    9898    // Create a handle.
    99     bool createHandle(Handle&);
     99    bool createHandle(Handle&, SharedMemory::Protection = SharedMemory::ReadWrite);
    100100
    101101    ~ShareableBitmap();
  • trunk/Source/WebKit2/UIProcess/API/mac/WKPrintingView.h

    r104377 r133935  
    3131
    3232namespace WebKit {
     33    class ShareableBitmap;
    3334    class WebFrameProxy;
    3435}
     
    4243    Vector<WebCore::IntRect> _printingPageRects;
    4344    double _totalScaleFactorForPrinting;
    44     HashMap<WebCore::IntRect, Vector<uint8_t> > _pagePreviews;
     45    HashMap<WebCore::IntRect, RefPtr<WebKit::ShareableBitmap> > _pagePreviews;
    4546
    4647    Vector<uint8_t> _printedPagesData;
  • trunk/Source/WebKit2/UIProcess/API/mac/WKPrintingView.mm

    r130612 r133935  
    3030#import "PDFKitImports.h"
    3131#import "PrintInfo.h"
     32#import "ShareableBitmap.h"
    3233#import "WebData.h"
    3334#import "WebPageProxy.h"
    3435#import <PDFKit/PDFKit.h>
     36#import <WebCore/GraphicsContext.h>
    3537#import <WebCore/WebCoreObjCExtras.h>
    3638#import <wtf/MainThread.h>
     
    206208};
    207209
     210static void pageDidDrawToImage(const ShareableBitmap::Handle& imageHandle, WKErrorRef, void* untypedContext)
     211{
     212    ASSERT(isMainThread());
     213
     214    OwnPtr<IPCCallbackContext> context = adoptPtr(static_cast<IPCCallbackContext*>(untypedContext));
     215    WKPrintingView *view = context->view.get();
     216
     217    // If the user has already changed print setup, then this response is obsolete. And if this callback is not in response to the latest request,
     218    // then the user has already moved to another page - we'll cache the response, but won't draw it.
     219    HashMap<uint64_t, WebCore::IntRect>::iterator iter = view->_expectedPreviewCallbacks.find(context->callbackID);
     220    if (iter != view->_expectedPreviewCallbacks.end()) {
     221        ASSERT([view _isPrintingPreview]);
     222
     223        if (!imageHandle.isNull()) {
     224            RefPtr<ShareableBitmap> image = ShareableBitmap::create(imageHandle, SharedMemory::ReadOnly);
     225
     226            if (image)
     227                view->_pagePreviews.add(iter->value, image);
     228        }
     229
     230        view->_expectedPreviewCallbacks.remove(context->callbackID);
     231        bool receivedResponseToLatestRequest = view->_latestExpectedPreviewCallback == context->callbackID;
     232        if (receivedResponseToLatestRequest) {
     233            view->_latestExpectedPreviewCallback = 0;
     234            [view _updatePreview];
     235        }
     236    }
     237}
     238
    208239static void pageDidDrawToPDF(WKDataRef dataRef, WKErrorRef, void* untypedContext)
    209240{
     
    222253        view->_expectedPrintCallback = 0;
    223254        view->_printingCallbackCondition.signal();
    224     } else {
    225         // If the user has already changed print setup, then this response is obsolete. And this callback is not in response to the latest request,
    226         // then the user has already moved to another page - we'll cache the response, but won't draw it.
    227         HashMap<uint64_t, WebCore::IntRect>::iterator iter = view->_expectedPreviewCallbacks.find(context->callbackID);
    228         if (iter != view->_expectedPreviewCallbacks.end()) {
    229             ASSERT([view _isPrintingPreview]);
    230 
    231             if (data) {
    232                 HashMap<WebCore::IntRect, Vector<uint8_t> >::AddResult entry = view->_pagePreviews.add(iter->value, Vector<uint8_t>());
    233                 entry.iterator->value.append(data->bytes(), data->size());
    234             }
    235             view->_expectedPreviewCallbacks.remove(context->callbackID);
    236             bool receivedResponseToLatestRequest = view->_latestExpectedPreviewCallback == context->callbackID;
    237             if (receivedResponseToLatestRequest) {
    238                 view->_latestExpectedPreviewCallback = 0;
    239                 [view _updatePreview];
    240             }
    241         }
    242255    }
    243256}
     
    462475    IntRect rect(nsRect);
    463476    rect.scale(1 / _totalScaleFactorForPrinting);
    464     HashMap<WebCore::IntRect, Vector<uint8_t> >::iterator pagePreviewIterator = _pagePreviews.find(rect);
     477    HashMap<WebCore::IntRect, RefPtr<ShareableBitmap> >::iterator pagePreviewIterator = _pagePreviews.find(rect);
    465478    if (pagePreviewIterator == _pagePreviews.end())  {
    466479        // It's too early to ask for page preview if we don't even know page size and scale.
     
    479492
    480493                IPCCallbackContext* context = new IPCCallbackContext;
    481                 RefPtr<DataCallback> callback = DataCallback::create(context, pageDidDrawToPDF);
     494                RefPtr<ImageCallback> callback = ImageCallback::create(context, pageDidDrawToImage);
    482495                _latestExpectedPreviewCallback = callback->callbackID();
    483496                _expectedPreviewCallbacks.add(_latestExpectedPreviewCallback, rect);
     
    486499                context->callbackID = callback->callbackID();
    487500
    488                 _webFrame->page()->drawRectToPDF(_webFrame.get(), PrintInfo([_printOperation printInfo]), rect, callback.get());
     501                _webFrame->page()->drawRectToImage(_webFrame.get(), PrintInfo([_printOperation printInfo]), rect, callback.get());
    489502                return;
    490503            }
     
    495508    }
    496509
    497     const Vector<uint8_t>& pdfDataBytes = pagePreviewIterator->value;
    498     RetainPtr<NSData> pdfData(AdoptNS, [[NSData alloc] initWithBytes:pdfDataBytes.data() length:pdfDataBytes.size()]);
    499     RetainPtr<PDFDocument> pdfDocument(AdoptNS, [[pdfDocumentClass() alloc] initWithData:pdfData.get()]);
    500 
    501     [self _drawPDFDocument:pdfDocument.get() page:0 atPoint:NSMakePoint(nsRect.origin.x, nsRect.origin.y)];
     510    RefPtr<ShareableBitmap> bitmap = pagePreviewIterator->value;
     511    CGContextRef cgContext = static_cast<CGContextRef>([[NSGraphicsContext currentContext] graphicsPort]);
     512
     513    GraphicsContext context(cgContext);
     514    GraphicsContextStateSaver stateSaver(context);
     515
     516    context.translate(nsRect.origin.x, nsRect.origin.y);
     517    context.scale(FloatSize(_totalScaleFactorForPrinting, _totalScaleFactorForPrinting));
     518
     519    // FIXME: Should we get the WebPage's deviceScaleFactor from here instead?
     520    const IntRect& imageBounds = bitmap->bounds();
     521    float imageScaleFactor = imageBounds.width() / rect.width();
     522
     523    bitmap->paint(context, imageScaleFactor, IntPoint(), imageBounds);
    502524}
    503525
  • trunk/Source/WebKit2/UIProcess/GenericCallback.h

    r128683 r133935  
    2727#define GenericCallback_h
    2828
     29#include "ShareableBitmap.h"
    2930#include "WKAPICast.h"
    30 
    3131#include "WebError.h"
    3232#include <wtf/HashMap.h>
     
    193193    }
    194194
     195    CallbackFunction m_callback;
     196};
     197
     198class ImageCallback : public CallbackBase {
     199public:
     200    typedef void (*CallbackFunction)(const ShareableBitmap::Handle&, WKErrorRef, void*);
     201
     202    static PassRefPtr<ImageCallback> create(void* context, CallbackFunction callback)
     203    {
     204        return adoptRef(new ImageCallback(context, callback));
     205    }
     206
     207    virtual ~ImageCallback()
     208    {
     209        ASSERT(!m_callback);
     210    }
     211
     212    void performCallbackWithReturnValue(const ShareableBitmap::Handle& returnValue1)
     213    {
     214        ASSERT(m_callback);
     215
     216        m_callback(returnValue1, 0, context());
     217
     218        m_callback = 0;
     219    }
     220
     221    void invalidate()
     222    {
     223        ASSERT(m_callback);
     224
     225        RefPtr<WebError> error = WebError::create();
     226        ShareableBitmap::Handle handle;
     227        m_callback(handle, toAPI(error.get()), context());
     228
     229        m_callback = 0;
     230    }
     231
     232private:
     233
     234    ImageCallback(void* context, CallbackFunction callback)
     235        : CallbackBase(context)
     236        , m_callback(callback)
     237    {
     238    }
     239   
    195240    CallbackFunction m_callback;
    196241};
  • trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp

    r133828 r133935  
    497497    invalidateCallbackMap(m_voidCallbacks);
    498498    invalidateCallbackMap(m_dataCallbacks);
     499    invalidateCallbackMap(m_imageCallbacks);
    499500    invalidateCallbackMap(m_stringCallbacks);
    500501    m_loadDependentStringCallbackIDs.clear();
     
    34743475
    34753476    callback->performCallbackWithReturnValue(WebData::create(dataReference.data(), dataReference.size()).get());
     3477}
     3478
     3479void WebPageProxy::imageCallback(const ShareableBitmap::Handle& bitmapHandle, uint64_t callbackID)
     3480{
     3481    RefPtr<ImageCallback> callback = m_imageCallbacks.take(callbackID);
     3482    if (!callback) {
     3483        // FIXME: Log error or assert.
     3484        return;
     3485    }
     3486
     3487    callback->performCallbackWithReturnValue(bitmapHandle);
    34763488}
    34773489
     
    40104022
    40114023#if PLATFORM(MAC) || PLATFORM(WIN)
    4012 void WebPageProxy::drawRectToPDF(WebFrameProxy* frame, const PrintInfo& printInfo, const IntRect& rect, PassRefPtr<DataCallback> prpCallback)
    4013 {
    4014     RefPtr<DataCallback> callback = prpCallback;
     4024void WebPageProxy::drawRectToImage(WebFrameProxy* frame, const PrintInfo& printInfo, const IntRect& rect, PassRefPtr<ImageCallback> prpCallback)
     4025{
     4026    RefPtr<ImageCallback> callback = prpCallback;
    40154027    if (!isValid()) {
    40164028        callback->invalidate();
     
    40194031   
    40204032    uint64_t callbackID = callback->callbackID();
    4021     m_dataCallbacks.set(callbackID, callback.get());
    4022     m_process->send(Messages::WebPage::DrawRectToPDF(frame->frameID(), printInfo, rect, callbackID), m_pageID, m_isPerformingDOMPrintOperation ? CoreIPC::DispatchMessageEvenWhenWaitingForSyncReply : 0);
     4033    m_imageCallbacks.set(callbackID, callback.get());
     4034    m_process->send(Messages::WebPage::DrawRectToImage(frame->frameID(), printInfo, rect, callbackID), m_pageID, m_isPerformingDOMPrintOperation ? CoreIPC::DispatchMessageEvenWhenWaitingForSyncReply : 0);
    40234035}
    40244036
  • trunk/Source/WebKit2/UIProcess/WebPageProxy.h

    r133828 r133935  
    698698    void computePagesForPrinting(WebFrameProxy*, const PrintInfo&, PassRefPtr<ComputedPagesCallback>);
    699699#if PLATFORM(MAC) || PLATFORM(WIN)
    700     void drawRectToPDF(WebFrameProxy*, const PrintInfo&, const WebCore::IntRect&, PassRefPtr<DataCallback>);
     700    void drawRectToImage(WebFrameProxy*, const PrintInfo&, const WebCore::IntRect&, PassRefPtr<ImageCallback>);
    701701    void drawPagesToPDF(WebFrameProxy*, const PrintInfo&, uint32_t first, uint32_t count, PassRefPtr<DataCallback>);
    702702#elif PLATFORM(GTK)
     
    974974    void voidCallback(uint64_t);
    975975    void dataCallback(const CoreIPC::DataReference&, uint64_t);
     976    void imageCallback(const ShareableBitmap::Handle&, uint64_t);
    976977    void stringCallback(const String&, uint64_t);
    977978    void scriptValueCallback(const CoreIPC::DataReference&, uint64_t);
     
    10781079    HashMap<uint64_t, RefPtr<VoidCallback> > m_voidCallbacks;
    10791080    HashMap<uint64_t, RefPtr<DataCallback> > m_dataCallbacks;
     1081    HashMap<uint64_t, RefPtr<ImageCallback> > m_imageCallbacks;
    10801082    HashMap<uint64_t, RefPtr<StringCallback> > m_stringCallbacks;
    10811083    HashSet<uint64_t> m_loadDependentStringCallbackIDs;
  • trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in

    r132228 r133935  
    166166    VoidCallback(uint64_t callbackID)
    167167    DataCallback(CoreIPC::DataReference resultData, uint64_t callbackID)
     168    ImageCallback(WebKit::ShareableBitmap::Handle bitmapHandle, uint64_t callbackID)
    168169    StringCallback(WTF::String resultString, uint64_t callbackID)
    169170    ScriptValueCallback(CoreIPC::DataReference resultData, uint64_t callbackID)
  • trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp

    r133871 r133935  
    31763176
    31773177#if PLATFORM(MAC) || PLATFORM(WIN)
    3178 void WebPage::drawRectToPDF(uint64_t frameID, const PrintInfo& printInfo, const WebCore::IntRect& rect, uint64_t callbackID)
     3178void WebPage::drawRectToImage(uint64_t frameID, const PrintInfo& printInfo, const WebCore::IntRect& rect, uint64_t callbackID)
    31793179{
    31803180    WebFrame* frame = WebProcess::shared().webFrame(frameID);
    31813181    Frame* coreFrame = frame ? frame->coreFrame() : 0;
    31823182
    3183     RetainPtr<CFMutableDataRef> pdfPageData(AdoptCF, CFDataCreateMutable(0, 0));
     3183    RefPtr<WebImage> image;
    31843184
    31853185#if USE(CG)
     
    31903190        ASSERT(coreFrame->document()->printing());
    31913191#endif
    3192 
    3193         // FIXME: Use CGDataConsumerCreate with callbacks to avoid copying the data.
    3194         RetainPtr<CGDataConsumerRef> pdfDataConsumer(AdoptCF, CGDataConsumerCreateWithCFData(pdfPageData.get()));
    3195 
    3196         CGRect mediaBox = CGRectMake(0, 0, rect.width(), rect.height());
    3197         RetainPtr<CGContextRef> context(AdoptCF, CGPDFContextCreate(pdfDataConsumer.get(), &mediaBox, 0));
    3198         RetainPtr<CFDictionaryRef> pageInfo(AdoptCF, CFDictionaryCreateMutable(0, 0, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks));
    3199         CGPDFContextBeginPage(context.get(), pageInfo.get());
    3200 
    32013192#if PLATFORM(MAC)
    32023193        if (RetainPtr<PDFDocument> pdfDocument = pdfDocumentForPrintingFrame(coreFrame)) {
    32033194            ASSERT(!m_printContext);
    3204             drawRectToPDFFromPDFDocument(context.get(), pdfDocument.get(), printInfo, rect);
     3195            RefPtr<ShareableBitmap> bitmap = ShareableBitmap::createShareable(rect.size(), ShareableBitmap::SupportsAlpha);
     3196            OwnPtr<GraphicsContext> graphicsContext = bitmap->createGraphicsContext();
     3197            graphicsContext->scale(FloatSize(1, -1));
     3198            graphicsContext->translate(0, -rect.height());
     3199            drawPDFDocument(graphicsContext->platformContext(), pdfDocument.get(), printInfo, rect);
     3200            image = WebImage::create(bitmap.release());
    32053201        } else
    32063202#endif
    32073203        {
    3208             GraphicsContext ctx(context.get());
    3209             ctx.scale(FloatSize(1, -1));
    3210             ctx.translate(0, -rect.height());
    3211             m_printContext->spoolRect(ctx, rect);
     3204            image = scaledSnapshotWithOptions(rect, 1, SnapshotOptionsShareable | SnapshotOptionsExcludeSelectionHighlighting);
    32123205        }
    3213 
    3214         CGPDFContextEndPage(context.get());
    3215         CGPDFContextClose(context.get());
    3216     }
    3217 #endif
    3218 
    3219     send(Messages::WebPageProxy::DataCallback(CoreIPC::DataReference(CFDataGetBytePtr(pdfPageData.get()), CFDataGetLength(pdfPageData.get())), callbackID));
     3206    }
     3207#endif
     3208
     3209    ShareableBitmap::Handle handle;
     3210
     3211    if (image)
     3212        image->bitmap()->createHandle(handle, SharedMemory::ReadOnly);
     3213
     3214    send(Messages::WebPageProxy::ImageCallback(handle, callbackID));
    32203215}
    32213216
  • trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h

    r132780 r133935  
    519519    void computePagesForPrinting(uint64_t frameID, const PrintInfo&, uint64_t callbackID);
    520520#if PLATFORM(MAC) || PLATFORM(WIN)
    521     void drawRectToPDF(uint64_t frameID, const PrintInfo&, const WebCore::IntRect&, uint64_t callbackID);
     521    void drawRectToImage(uint64_t frameID, const PrintInfo&, const WebCore::IntRect&, uint64_t callbackID);
    522522    void drawPagesToPDF(uint64_t frameID, const PrintInfo&, uint32_t first, uint32_t count, uint64_t callbackID);
    523523#elif PLATFORM(GTK)
     
    725725    RetainPtr<PDFDocument> pdfDocumentForPrintingFrame(WebCore::Frame*);
    726726    void computePagesForPrintingPDFDocument(uint64_t frameID, const PrintInfo&, Vector<WebCore::IntRect>& resultPageRects);
    727     void drawRectToPDFFromPDFDocument(CGContextRef, PDFDocument *, const PrintInfo&, const WebCore::IntRect&);
     727    void drawPDFDocument(CGContextRef, PDFDocument *, const PrintInfo&, const WebCore::IntRect&);
    728728    void drawPagesToPDFFromPDFDocument(CGContextRef, PDFDocument *, const PrintInfo&, uint32_t first, uint32_t count);
    729729#endif
  • trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in

    r132210 r133935  
    218218    ComputePagesForPrinting(uint64_t frameID, WebKit::PrintInfo printInfo, uint64_t callbackID)
    219219#if PLATFORM(MAC) || PLATFORM(WIN)
    220     DrawRectToPDF(uint64_t frameID, WebKit::PrintInfo printInfo, WebCore::IntRect rect, uint64_t callbackID)
     220    DrawRectToImage(uint64_t frameID, WebKit::PrintInfo printInfo, WebCore::IntRect rect, uint64_t callbackID)
    221221    DrawPagesToPDF(uint64_t frameID, WebKit::PrintInfo printInfo, uint32_t first, uint32_t count, uint64_t callbackID)
    222222#endif
  • trunk/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm

    r133410 r133935  
    838838}
    839839
    840 void WebPage::drawRectToPDFFromPDFDocument(CGContextRef context, PDFDocument *pdfDocument, const PrintInfo& printInfo, const WebCore::IntRect& rect)
     840void WebPage::drawPDFDocument(CGContextRef context, PDFDocument *pdfDocument, const PrintInfo& printInfo, const WebCore::IntRect& rect)
    841841{
    842842    NSUInteger pageCount = [pdfDocument pageCount];
Note: See TracChangeset for help on using the changeset viewer.