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

Unified Diff: third_party/WebKit/Source/web/WebLocalFrameImpl.cpp

Issue 2791043002: Draw recorded content directly into the containing PaintCanvas, when possible. (Closed)
Patch Set: none Created 3 years, 9 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
« no previous file with comments | « third_party/WebKit/Source/web/PageWidgetDelegate.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/web/WebLocalFrameImpl.cpp
diff --git a/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp b/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp
index 542a97aa660f388ba2681679f7aebbc97263fa79..b92e52d602d25a9090d272ad76e8b92b69dbb01f 100644
--- a/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp
+++ b/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp
@@ -330,45 +330,43 @@ class ChromePrintContext : public PrintContext {
IntRect allPagesRect(0, 0, pageWidth, totalHeight);
PaintRecordBuilder builder(allPagesRect, &canvas->getMetaData());
- {
- GraphicsContext& context = builder.context();
- context.setPrinting(true);
- context.beginRecording(allPagesRect);
-
- // Fill the whole background by white.
- context.fillRect(FloatRect(0, 0, pageWidth, totalHeight), Color::white);
-
- int currentHeight = 0;
- for (size_t pageIndex = 0; pageIndex < numPages; pageIndex++) {
- // Draw a line for a page boundary if this isn't the first page.
- if (pageIndex > 0) {
- context.save();
- context.setStrokeColor(Color(0, 0, 255));
- context.setFillColor(Color(0, 0, 255));
- context.drawLine(IntPoint(0, currentHeight),
- IntPoint(pageWidth, currentHeight));
- context.restore();
- }
+ GraphicsContext& context = builder.context();
+ context.setPrinting(true);
+ context.beginRecording(allPagesRect);
+
+ // Fill the whole background by white.
+ context.fillRect(FloatRect(0, 0, pageWidth, totalHeight), Color::white);
+
+ int currentHeight = 0;
+ for (size_t pageIndex = 0; pageIndex < numPages; pageIndex++) {
+ // Draw a line for a page boundary if this isn't the first page.
+ if (pageIndex > 0) {
+ context.save();
+ context.setStrokeColor(Color(0, 0, 255));
+ context.setFillColor(Color(0, 0, 255));
+ context.drawLine(IntPoint(0, currentHeight),
+ IntPoint(pageWidth, currentHeight));
+ context.restore();
+ }
- AffineTransform transform;
- transform.translate(0, currentHeight);
+ AffineTransform transform;
+ transform.translate(0, currentHeight);
#if OS(WIN) || OS(MACOSX)
- // Account for the disabling of scaling in spoolPage. In the context
- // of spoolAllPagesWithBoundaries the scale HAS NOT been pre-applied.
- float scale = getPageShrink(pageIndex);
- transform.scale(scale, scale);
+ // Account for the disabling of scaling in spoolPage. In the context
+ // of spoolAllPagesWithBoundaries the scale HAS NOT been pre-applied.
+ float scale = getPageShrink(pageIndex);
+ transform.scale(scale, scale);
#endif
- context.save();
- context.concatCTM(transform);
+ context.save();
+ context.concatCTM(transform);
- spoolPage(context, pageIndex, allPagesRect);
+ spoolPage(context, pageIndex, allPagesRect);
- context.restore();
+ context.restore();
- currentHeight += pageSizeInPixels.height() + 1;
- }
- canvas->PlaybackPaintRecord(context.endRecording());
+ currentHeight += pageSizeInPixels.height() + 1;
}
+ canvas->PlaybackPaintRecord(context.endRecording());
}
protected:
« no previous file with comments | « third_party/WebKit/Source/web/PageWidgetDelegate.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698