Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1475)

Unified Diff: Source/core/page/PrintContext.cpp

Issue 465983003: Delete PrintContext::spoolAllPagesWithBoundaries (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/page/PrintContext.cpp
diff --git a/Source/core/page/PrintContext.cpp b/Source/core/page/PrintContext.cpp
index 03fb87e13b9b9caf9de253d8193e3cd6c944796b..bd923317a0d90db7335f338a56109ad53b1030a5 100644
--- a/Source/core/page/PrintContext.cpp
+++ b/Source/core/page/PrintContext.cpp
@@ -171,22 +171,6 @@ void PrintContext::begin(float width, float height)
m_frame->setPrinting(true, minLayoutSize, originalPageSize, printingMaximumShrinkFactor / printingMinimumShrinkFactor);
}
-void PrintContext::spoolPage(GraphicsContext& ctx, int pageNumber, float width)
-{
- // FIXME: Not correct for vertical text.
- IntRect pageRect = m_pageRects[pageNumber];
- float scale = width / pageRect.width();
-
- ctx.save();
- ctx.scale(scale, scale);
- ctx.translate(-pageRect.x(), -pageRect.y());
- ctx.clip(pageRect);
- m_frame->view()->paintContents(&ctx, pageRect);
- if (ctx.supportsURLFragments())
- outputLinkedDestinations(ctx, m_frame->document(), pageRect);
- ctx.restore();
-}
-
void PrintContext::end()
{
ASSERT(m_isPrinting);
@@ -331,54 +315,6 @@ int PrintContext::numberOfPages(LocalFrame* frame, const FloatSize& pageSizeInPi
return printContext.pageCount();
}
-void PrintContext::spoolAllPagesWithBoundaries(LocalFrame* frame, GraphicsContext& graphicsContext, const FloatSize& pageSizeInPixels)
-{
- if (!frame->document() || !frame->view() || !frame->document()->renderView())
- return;
-
- frame->document()->updateLayout();
-
- PrintContext printContext(frame);
- printContext.begin(pageSizeInPixels.width(), pageSizeInPixels.height());
-
- float pageHeight;
- printContext.computePageRects(FloatRect(FloatPoint(0, 0), pageSizeInPixels), 0, 0, 1, pageHeight);
-
- const float pageWidth = pageSizeInPixels.width();
- const Vector<IntRect>& pageRects = printContext.pageRects();
- int totalHeight = pageRects.size() * (pageSizeInPixels.height() + 1) - 1;
-
- // Fill the whole background by white.
- graphicsContext.setFillColor(Color(255, 255, 255));
- graphicsContext.fillRect(FloatRect(0, 0, pageWidth, totalHeight));
-
- graphicsContext.save();
- graphicsContext.translate(0, totalHeight);
- graphicsContext.scale(1, -1);
-
- int currentHeight = 0;
- for (size_t pageIndex = 0; pageIndex < pageRects.size(); pageIndex++) {
- // Draw a line for a page boundary if this isn't the first page.
- if (pageIndex > 0) {
- graphicsContext.save();
- graphicsContext.setStrokeColor(Color(0, 0, 255));
- graphicsContext.setFillColor(Color(0, 0, 255));
- graphicsContext.drawLine(IntPoint(0, currentHeight),
- IntPoint(pageWidth, currentHeight));
- graphicsContext.restore();
- }
-
- graphicsContext.save();
- graphicsContext.translate(0, currentHeight);
- printContext.spoolPage(graphicsContext, pageIndex, pageWidth);
- graphicsContext.restore();
-
- currentHeight += pageSizeInPixels.height() + 1;
- }
-
- graphicsContext.restore();
-}
-
void PrintContext::trace(Visitor* visitor)
{
#if ENABLE(OILPAN)

Powered by Google App Engine
This is Rietveld 408576698