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

Side by Side Diff: third_party/WebKit/Source/core/paint/RemoteFramePainter.cpp

Issue 2653963002: [Experimental] Supporting OOPIF printing
Patch Set: Rename service, fix for webview, and connect to DiscardableMemoryManager Created 3 years, 8 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "core/paint/RemoteFramePainter.h"
6
7 #include "third_party/WebKit/Source/core/frame/RemoteFrameView.h"
8 #include "third_party/WebKit/Source/platform/graphics/GraphicsContext.h"
9 #include "third_party/WebKit/Source/platform/graphics/paint/CullRect.h"
10 #include "third_party/WebKit/Source/platform/graphics/paint/DrawingRecorder.h"
11 #include "third_party/WebKit/Source/platform/graphics/paint/PaintRecordBuilder.h "
12 #include "third_party/WebKit/public/web/WebRemoteFrame.h"
13 #include "third_party/skia/include/core/SkCanvas.h"
14 #include "third_party/skia/include/core/SkPictureRecorder.h"
15 #include "third_party/skia/include/core/SkRect.h"
16
17 namespace blink {
18
19 void RemoteFramePainter::paint(GraphicsContext& context,
20 const CullRect& rect) const {
21 DCHECK(context.printing());
22
23 IntRect bound(m_frameView.frameRect());
24 SkRect skRect;
25 skRect.iset(bound.x(), bound.y(), bound.x() + bound.width(),
26 bound.y() + bound.height());
27
28 // Inform the actual frame printing.
29 int id = m_frameView.print(bound, context.printPageNumber());
30
31 if (!drawable_)
32 drawable_.reset(new SkFutureDrawable(skRect, id));
33
34 DrawingRecorder drawRecorder(context, m_frameView,
35 DisplayItem::kDocumentBackground,
36 FloatRect(skRect));
37 DCHECK(context.canvas());
38 context.canvas()->drawDrawable(drawable_.get());
39 }
40
41 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698