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

Unified Diff: third_party/WebKit/Source/core/frame/LocalFrame.cpp

Issue 2791043002: Draw recorded content directly into the containing PaintCanvas, when possible. (Closed)
Patch Set: none 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/core/frame/LocalFrame.cpp
diff --git a/third_party/WebKit/Source/core/frame/LocalFrame.cpp b/third_party/WebKit/Source/core/frame/LocalFrame.cpp
index e9e50a65b9aadbcc403d5d7ad2a54be429e7b534..bdd0886f924ac533c16a5dda73ecb115d2053c4d 100644
--- a/third_party/WebKit/Source/core/frame/LocalFrame.cpp
+++ b/third_party/WebKit/Source/core/frame/LocalFrame.cpp
@@ -128,7 +128,7 @@ static std::unique_ptr<DragImage> createDragImage(
float opacity,
RespectImageOrientationEnum imageOrientation,
const FloatRect& cssBounds,
- sk_sp<PaintRecord> contents) {
+ PaintRecordBuilder& builder) {
float deviceScaleFactor = frame.page()->deviceScaleFactorDeprecated();
float pageScaleFactor = frame.page()->visualViewport().scale();
@@ -141,7 +141,7 @@ static std::unique_ptr<DragImage> createDragImage(
PaintRecorder recorder;
PaintCanvas* canvas = recorder.beginRecording(deviceBounds);
canvas->concat(affineTransformToSkMatrix(transform));
- canvas->drawPicture(contents);
+ builder.endRecording(*canvas);
// Rasterize upfront, since DragImage::create() is going to do it anyway
// (SkImage::asLegacyBitmap).
@@ -216,7 +216,7 @@ class DraggedNodeImageBuilder {
return createDragImage(
*m_localFrame, 1.0f,
LayoutObject::shouldRespectImageOrientation(draggedLayoutObject),
- boundingBox, builder.endRecording());
+ boundingBox, builder);
}
private:
@@ -738,7 +738,7 @@ std::unique_ptr<DragImage> LocalFrame::dragImageForSelection(float opacity) {
m_view->paintContents(builder.context(), paintFlags,
enclosingIntRect(paintingRect));
return createDragImage(*this, opacity, DoNotRespectImageOrientation,
- paintingRect, builder.endRecording());
+ paintingRect, builder);
}
String LocalFrame::selectedText() const {

Powered by Google App Engine
This is Rietveld 408576698