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

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

Issue 2653963002: [Experimental] Supporting OOPIF printing
Patch Set: Rename service, fix for webview, and connect to DiscardableMemoryManager 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
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 5a917d88d3f8e6dc534087a051f26899c2a9f089..f8ca51d914d3f17bf3c4819e11c7a7c430c26c1d 100644
--- a/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp
+++ b/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp
@@ -118,6 +118,7 @@
#include "core/editing/iterators/TextIterator.h"
#include "core/editing/serializers/Serialization.h"
#include "core/editing/spellcheck/SpellChecker.h"
+#include "core/frame/Frame.h"
#include "core/frame/FrameHost.h"
#include "core/frame/FrameView.h"
#include "core/frame/LocalDOMWindow.h"
@@ -153,7 +154,10 @@
#include "core/page/FrameTree.h"
#include "core/page/Page.h"
#include "core/page/PrintContext.h"
+#include "core/paint/PaintInfo.h"
#include "core/paint/PaintLayer.h"
+#include "core/paint/PaintLayerPainter.h"
+#include "core/paint/PaintLayerPaintingInfo.h"
#include "core/paint/TransformRecorder.h"
#include "core/style/StyleInheritedData.h"
#include "core/timing/DOMWindowPerformance.h"
@@ -169,6 +173,7 @@
#include "platform/graphics/GraphicsContext.h"
#include "platform/graphics/GraphicsLayerClient.h"
#include "platform/graphics/paint/ClipRecorder.h"
+#include "platform/graphics/paint/CullRect.h"
#include "platform/graphics/paint/DisplayItemCacheSkipper.h"
#include "platform/graphics/paint/DrawingRecorder.h"
#include "platform/graphics/paint/PaintRecordBuilder.h"
@@ -220,6 +225,7 @@
#include "skia/ext/platform_canvas.h"
#include "web/CompositionUnderlineVectorBuilder.h"
#include "web/FindInPageCoordinates.h"
+#include "web/RemoteFrameClientImpl.h"
#include "web/RemoteFrameOwner.h"
#include "web/SharedWorkerRepositoryClientImpl.h"
#include "web/SuspendableScriptExecutor.h"
@@ -305,9 +311,10 @@ class ChromePrintContext : public PrintContext {
IntRect pageRect = m_pageRects[pageNumber];
PaintRecordBuilder builder(pageRect, &skia::GetMetaData(*canvas));
builder.context().setPrinting(true);
+ builder.context().setPrintPageNumber(pageNumber);
float scale = spoolPage(builder, pageNumber);
- builder.endRecording()->playback(canvas);
+ canvas->drawDrawable(builder.endRecordingAsDrawable().get());
return scale;
}
@@ -398,8 +405,12 @@ class ChromePrintContext : public PrintContext {
ClipRecorder clipRecorder(context, builder, DisplayItem::kClipPrintedPage,
pageRect);
-
- frame()->view()->paintContents(context, GlobalPaintNormalPhase, pageRect);
+ if (frame()->isCrossOriginSubframe()) {
+ frame()->view()->paint(context, GlobalPaintNormalPhase,
+ CullRect(pageRect));
+ } else {
+ frame()->view()->paintContents(context, GlobalPaintNormalPhase, pageRect);
+ }
{
DrawingRecorder lineBoundaryRecorder(
« no previous file with comments | « third_party/WebKit/Source/web/RemoteFrameClientImpl.cpp ('k') | third_party/WebKit/public/web/WebPrintParams.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698