Chromium Code Reviews| 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); |