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

Unified Diff: sky/engine/core/frame/ImageBitmap.cpp

Issue 701663002: Remove HTMLVideoElement. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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 | « sky/engine/core/frame/ImageBitmap.h ('k') | sky/engine/core/frame/UseCounter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « sky/engine/core/frame/ImageBitmap.h ('k') | sky/engine/core/frame/UseCounter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698