| Index: third_party/WebKit/Source/core/paint/RemoteFramePainter.cpp
|
| diff --git a/third_party/WebKit/Source/core/paint/RemoteFramePainter.cpp b/third_party/WebKit/Source/core/paint/RemoteFramePainter.cpp
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..2650037e70b910f0619fa2197c26c2e003ca6898
|
| --- /dev/null
|
| +++ b/third_party/WebKit/Source/core/paint/RemoteFramePainter.cpp
|
| @@ -0,0 +1,41 @@
|
| +// Copyright 2017 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#include "core/paint/RemoteFramePainter.h"
|
| +
|
| +#include "third_party/WebKit/Source/core/frame/RemoteFrameView.h"
|
| +#include "third_party/WebKit/Source/platform/graphics/GraphicsContext.h"
|
| +#include "third_party/WebKit/Source/platform/graphics/paint/CullRect.h"
|
| +#include "third_party/WebKit/Source/platform/graphics/paint/DrawingRecorder.h"
|
| +#include "third_party/WebKit/Source/platform/graphics/paint/PaintRecordBuilder.h"
|
| +#include "third_party/WebKit/public/web/WebRemoteFrame.h"
|
| +#include "third_party/skia/include/core/SkCanvas.h"
|
| +#include "third_party/skia/include/core/SkPictureRecorder.h"
|
| +#include "third_party/skia/include/core/SkRect.h"
|
| +
|
| +namespace blink {
|
| +
|
| +void RemoteFramePainter::paint(GraphicsContext& context,
|
| + const CullRect& rect) const {
|
| + DCHECK(context.printing());
|
| +
|
| + IntRect bound(m_frameView.frameRect());
|
| + SkRect skRect;
|
| + skRect.iset(bound.x(), bound.y(), bound.x() + bound.width(),
|
| + bound.y() + bound.height());
|
| +
|
| + // Inform the actual frame printing.
|
| + int id = m_frameView.print(bound, context.printPageNumber());
|
| +
|
| + if (!drawable_)
|
| + drawable_.reset(new SkFutureDrawable(skRect, id));
|
| +
|
| + DrawingRecorder drawRecorder(context, m_frameView,
|
| + DisplayItem::kDocumentBackground,
|
| + FloatRect(skRect));
|
| + DCHECK(context.canvas());
|
| + context.canvas()->drawDrawable(drawable_.get());
|
| +}
|
| +
|
| +} // namespace blink
|
|
|