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

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 for shape bug 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
« no previous file with comments | « Source/core/frame/ImageBitmap.cpp ('k') | Source/core/html/canvas/WebGLRenderingContextBase.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/frame/LocalFrame.cpp
diff --git a/Source/core/frame/LocalFrame.cpp b/Source/core/frame/LocalFrame.cpp
index 0f3fad44f8817e90ccccd9c72ca8c5547ba0855c..916d83325825e564d987483575ce75016d8227e2 100644
--- a/Source/core/frame/LocalFrame.cpp
+++ b/Source/core/frame/LocalFrame.cpp
@@ -71,7 +71,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"
@@ -588,9 +588,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);
@@ -601,7 +601,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);
« no previous file with comments | « Source/core/frame/ImageBitmap.cpp ('k') | Source/core/html/canvas/WebGLRenderingContextBase.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698