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

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

Issue 1170523002: Removing GraphicsContext from ImageBuffer (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: fix unit test crashes Created 5 years, 6 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: Source/core/frame/LocalFrame.cpp
diff --git a/Source/core/frame/LocalFrame.cpp b/Source/core/frame/LocalFrame.cpp
index edd58bd52392b820387fa793d139f5e92d9a2a43..59f6a59612ed70ee0ab920a247420b6998ba3332 100644
--- a/Source/core/frame/LocalFrame.cpp
+++ b/Source/core/frame/LocalFrame.cpp
@@ -70,7 +70,7 @@
#include "platform/graphics/GraphicsContext.h"
#include "platform/graphics/ImageBuffer.h"
#include "platform/graphics/paint/ClipRecorder.h"
-#include "platform/graphics/paint/DisplayItemListContextRecorder.h"
+#include "platform/graphics/paint/SkPictureBuilder.h"
#include "platform/text/TextStream.h"
#include "wtf/PassOwnPtr.h"
#include "wtf/StdLibExtras.h"
@@ -567,9 +567,9 @@ PassOwnPtr<DragImage> LocalFrame::paintIntoDragImage(
if (!buffer)
return nullptr;
+ SkPictureBuilder pictureBuilder(paintingRect);
{
- DisplayItemListContextRecorder contextRecorder(*buffer->context());
- GraphicsContext& paintContext = contextRecorder.context();
+ GraphicsContext& paintContext = pictureBuilder.context();
AffineTransform transform;
transform.scale(deviceScaleFactor, deviceScaleFactor);
@@ -580,7 +580,10 @@ PassOwnPtr<DragImage> LocalFrame::paintIntoDragImage(
LayoutRect(0, 0, paintingRect.maxX(), paintingRect.maxY()));
m_view->paintContents(&paintContext, paintingRect);
+
}
+ RefPtr<const SkPicture> recording = pictureBuilder.endRecording();
+ buffer->canvas()->drawPicture(recording.get());
RefPtr<Image> image = buffer->copyImage();
return DragImage::create(image.get(), shouldRespectImageOrientation, deviceScaleFactor);

Powered by Google App Engine
This is Rietveld 408576698