Title: [136315] trunk/Source/WebKit2
Revision
136315
Author
[email protected]
Date
2012-12-01 23:44:46 -0800 (Sat, 01 Dec 2012)

Log Message

[wk2] Use spoolRect instead of snapshots for print preview
https://bugs.webkit.org/show_bug.cgi?id=103798
<rdar://problem/12686749>

Reviewed by Sam Weinig.

Revert to using spoolRect instead of snapshotting for printing; this was a bogus
change I made in http://trac.webkit.org/changeset/133935 which was irrelevant to
the core of that change, and incorrectly disregards the Frame parameter passed to
beginPrinting, instead using the WebPage's current Frame.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::drawRectToImage):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (136314 => 136315)


--- trunk/Source/WebKit2/ChangeLog	2012-12-02 07:06:01 UTC (rev 136314)
+++ trunk/Source/WebKit2/ChangeLog	2012-12-02 07:44:46 UTC (rev 136315)
@@ -1,3 +1,19 @@
+2012-12-01  Tim Horton  <[email protected]>
+
+        [wk2] Use spoolRect instead of snapshots for print preview
+        https://bugs.webkit.org/show_bug.cgi?id=103798
+        <rdar://problem/12686749>
+
+        Reviewed by Sam Weinig.
+
+        Revert to using spoolRect instead of snapshotting for printing; this was a bogus
+        change I made in http://trac.webkit.org/changeset/133935 which was irrelevant to
+        the core of that change, and incorrectly disregards the Frame parameter passed to
+        beginPrinting, instead using the WebPage's current Frame.
+
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::drawRectToImage):
+
 2012-11-30  Anders Carlsson  <[email protected]>
 
         Always listen for the DidFirstLayout layout milestone

Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (136314 => 136315)


--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2012-12-02 07:06:01 UTC (rev 136314)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2012-12-02 07:44:46 UTC (rev 136315)
@@ -3264,20 +3264,23 @@
 #else
         ASSERT(coreFrame->document()->printing());
 #endif
+
+        RefPtr<ShareableBitmap> bitmap = ShareableBitmap::createShareable(rect.size(), ShareableBitmap::SupportsAlpha);
+        OwnPtr<GraphicsContext> graphicsContext = bitmap->createGraphicsContext();
+
 #if PLATFORM(MAC)
         if (RetainPtr<PDFDocument> pdfDocument = pdfDocumentForPrintingFrame(coreFrame)) {
             ASSERT(!m_printContext);
-            RefPtr<ShareableBitmap> bitmap = ShareableBitmap::createShareable(rect.size(), ShareableBitmap::SupportsAlpha);
-            OwnPtr<GraphicsContext> graphicsContext = bitmap->createGraphicsContext();
             graphicsContext->scale(FloatSize(1, -1));
             graphicsContext->translate(0, -rect.height());
             drawPDFDocument(graphicsContext->platformContext(), pdfDocument.get(), printInfo, rect);
-            image = WebImage::create(bitmap.release());
         } else
 #endif
         {
-            image = scaledSnapshotWithOptions(rect, 1, SnapshotOptionsShareable | SnapshotOptionsExcludeSelectionHighlighting);
+            m_printContext->spoolRect(*graphicsContext, rect);
         }
+
+        image = WebImage::create(bitmap.release());
     }
 #endif
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to