Index: Source/web/WebLocalFrameImpl.cpp |
diff --git a/Source/web/WebLocalFrameImpl.cpp b/Source/web/WebLocalFrameImpl.cpp |
index 3df622c6a65f3df19209258b24f9a049d57bc149..d2c96fc3a352aa0880278eba1a7bfdb07c5c6862 100644 |
--- a/Source/web/WebLocalFrameImpl.cpp |
+++ b/Source/web/WebLocalFrameImpl.cpp |
@@ -395,25 +395,22 @@ public: |
GraphicsContext& context = pictureBuilder.context(); |
// Fill the whole background by white. |
- { |
+ if (!DrawingRecorder::useCachedDrawingIfPossible(context, *this, DisplayItem::PrintedContentBackground)) { |
DrawingRecorder backgroundRecorder(context, *this, DisplayItem::PrintedContentBackground, allPagesRect); |
- if (!backgroundRecorder.canUseCachedDrawing()) |
- context.fillRect(FloatRect(0, 0, pageWidth, totalHeight), Color::white); |
+ context.fillRect(FloatRect(0, 0, pageWidth, totalHeight), Color::white); |
} |
int currentHeight = 0; |
for (size_t pageIndex = 0; pageIndex < numPages; pageIndex++) { |
ScopeRecorder scopeRecorder(context, *this); |
// Draw a line for a page boundary if this isn't the first page. |
- if (pageIndex > 0) { |
+ if (pageIndex > 0 && !DrawingRecorder::useCachedDrawingIfPossible(context, *this, DisplayItem::PrintedContentLineBoundary)) { |
DrawingRecorder lineBoundaryRecorder(context, *this, DisplayItem::PrintedContentLineBoundary, allPagesRect); |
- if (!lineBoundaryRecorder.canUseCachedDrawing()) { |
- context.save(); |
- context.setStrokeColor(Color(0, 0, 255)); |
- context.setFillColor(Color(0, 0, 255)); |
- context.drawLine(IntPoint(0, currentHeight), IntPoint(pageWidth, currentHeight)); |
- context.restore(); |
- } |
+ 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; |