| Index: sky/engine/core/frame/ImageBitmap.cpp
|
| diff --git a/sky/engine/core/frame/ImageBitmap.cpp b/sky/engine/core/frame/ImageBitmap.cpp
|
| index 53544bb70c77a244f0872e7d4f57ecb3450aabdb..883cc4b59d50fee4ed8e6d06be8bd6e6a18dde37 100644
|
| --- a/sky/engine/core/frame/ImageBitmap.cpp
|
| +++ b/sky/engine/core/frame/ImageBitmap.cpp
|
| @@ -6,7 +6,6 @@
|
| #include "core/frame/ImageBitmap.h"
|
|
|
| #include "core/html/HTMLCanvasElement.h"
|
| -#include "core/html/HTMLVideoElement.h"
|
| #include "core/html/ImageData.h"
|
| #include "core/html/canvas/CanvasRenderingContext.h"
|
| #include "platform/graphics/BitmapImage.h"
|
| @@ -52,33 +51,6 @@ ImageBitmap::ImageBitmap(HTMLImageElement* image, const IntRect& cropRect)
|
| ScriptWrappable::init(this);
|
| }
|
|
|
| -ImageBitmap::ImageBitmap(HTMLVideoElement* video, const IntRect& cropRect)
|
| - : m_imageElement(nullptr)
|
| - , m_cropRect(cropRect)
|
| - , m_bitmapOffset(IntPoint())
|
| -{
|
| - IntSize playerSize;
|
| -
|
| - if (video->webMediaPlayer())
|
| - playerSize = video->webMediaPlayer()->naturalSize();
|
| -
|
| - IntRect videoRect = IntRect(IntPoint(), playerSize);
|
| - IntRect srcRect = intersection(cropRect, videoRect);
|
| - IntRect dstRect(IntPoint(), srcRect.size());
|
| -
|
| - OwnPtr<ImageBuffer> buf = ImageBuffer::create(videoRect.size());
|
| - if (!buf)
|
| - return;
|
| - GraphicsContext* c = buf->context();
|
| - c->clip(dstRect);
|
| - c->translate(-srcRect.x(), -srcRect.y());
|
| - video->paintCurrentFrameInContext(c, videoRect);
|
| - m_bitmap = buf->copyImage(DontCopyBackingStore);
|
| - m_bitmapRect = IntRect(IntPoint(std::max(0, -cropRect.x()), std::max(0, -cropRect.y())), srcRect.size());
|
| -
|
| - ScriptWrappable::init(this);
|
| -}
|
| -
|
| ImageBitmap::ImageBitmap(HTMLCanvasElement* canvas, const IntRect& cropRect)
|
| : m_imageElement(nullptr)
|
| , m_cropRect(cropRect)
|
| @@ -160,12 +132,6 @@ PassRefPtr<ImageBitmap> ImageBitmap::create(HTMLImageElement* image, const IntRe
|
| return adoptRef(new ImageBitmap(image, normalizedCropRect));
|
| }
|
|
|
| -PassRefPtr<ImageBitmap> ImageBitmap::create(HTMLVideoElement* video, const IntRect& cropRect)
|
| -{
|
| - IntRect normalizedCropRect = normalizeRect(cropRect);
|
| - return adoptRef(new ImageBitmap(video, normalizedCropRect));
|
| -}
|
| -
|
| PassRefPtr<ImageBitmap> ImageBitmap::create(HTMLCanvasElement* canvas, const IntRect& cropRect)
|
| {
|
| IntRect normalizedCropRect = normalizeRect(cropRect);
|
|
|