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

Unified Diff: Source/core/frame/ImageBitmap.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
« no previous file with comments | « no previous file | Source/core/frame/LocalFrame.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/frame/ImageBitmap.cpp
diff --git a/Source/core/frame/ImageBitmap.cpp b/Source/core/frame/ImageBitmap.cpp
index ee76ed53a8be351bbcad4a73ed051e29ffbdf3ef..202fc0fca6700769ccd2dbc01ddcdcbbecc8ac3c 100644
--- a/Source/core/frame/ImageBitmap.cpp
+++ b/Source/core/frame/ImageBitmap.cpp
@@ -11,8 +11,8 @@
#include "platform/graphics/BitmapImage.h"
#include "platform/graphics/GraphicsContext.h"
#include "platform/graphics/ImageBuffer.h"
-#include "platform/graphics/paint/DisplayItemListContextRecorder.h"
#include "platform/graphics/paint/DrawingRecorder.h"
+#include "platform/graphics/paint/SkPictureBuilder.h"
#include "wtf/RefPtr.h"
namespace blink {
@@ -73,9 +73,9 @@ ImageBitmap::ImageBitmap(HTMLVideoElement* video, const IntRect& cropRect)
if (!buffer)
return;
+ SkPictureBuilder pictureBuilder(videoRect);
{
- DisplayItemListContextRecorder contextRecorder(*buffer->context());
- GraphicsContext& paintContext = contextRecorder.context();
+ GraphicsContext& paintContext = pictureBuilder.context();
DrawingRecorder recorder(paintContext, *buffer, DisplayItem::VideoBitmap, videoRect);
if (!recorder.canUseCachedDrawing()) {
@@ -83,6 +83,8 @@ ImageBitmap::ImageBitmap(HTMLVideoElement* video, const IntRect& cropRect)
paintContext.translate(-srcRect.x(), -srcRect.y());
}
}
+ RefPtr<const SkPicture> recording = pictureBuilder.endRecording();
+ buffer->canvas()->drawPicture(recording.get());
Stephen White 2015/06/04 18:33:10 chrishtr@: Not new to this patch, but why are we g
chrishtr 2015/06/04 19:58:00 Agree that this looks wrong and we should just dra
video->paintCurrentFrame(buffer->canvas(), videoRect, nullptr);
m_bitmap = buffer->copyImage(DontCopyBackingStore);
« no previous file with comments | « no previous file | Source/core/frame/LocalFrame.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698