Index: Source/web/WebLocalFrameImpl.cpp |
diff --git a/Source/web/WebLocalFrameImpl.cpp b/Source/web/WebLocalFrameImpl.cpp |
index f1e1db030342a77460108de87045e783cfa43ed5..500d2154b9af46b469d41da83fbec5e8f94c17d2 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; |