| Index: Source/core/frame/ImageBitmap.cpp
|
| diff --git a/Source/core/frame/ImageBitmap.cpp b/Source/core/frame/ImageBitmap.cpp
|
| index 53567bd01655417a20ddcb3b9c280d32ba29d7a1..e902ca5558e74e307314e3140b76843d318a4c1e 100644
|
| --- a/Source/core/frame/ImageBitmap.cpp
|
| +++ b/Source/core/frame/ImageBitmap.cpp
|
| @@ -200,4 +200,29 @@ PassRefPtr<Image> ImageBitmap::bitmapImage() const
|
| return m_bitmap;
|
| }
|
|
|
| +PassRefPtr<Image> ImageBitmap::getSourceImageForCanvas(HTMLCanvasElement*, ExceptionState&, CanvasImageSourceUsage usage, bool* isVolatile) const
|
| +{
|
| + if (isVolatile)
|
| + *isVolatile = false;
|
| + return bitmapImage();
|
| +}
|
| +
|
| +void ImageBitmap::adjustDrawRects(FloatRect* srcRect, FloatRect* dstRect) const
|
| +{
|
| + FloatRect intersectRect = intersection(m_bitmapRect, *srcRect);
|
| + FloatRect newSrcRect = intersectRect;
|
| + newSrcRect.move(m_bitmapOffset - m_bitmapRect.location());
|
| + FloatRect newDstRect(FloatPoint(intersectRect.location() - srcRect->location()), m_bitmapRect.size());
|
| + newDstRect.scale(dstRect->width() / srcRect->width() * intersectRect.width() / m_bitmapRect.width(),
|
| + dstRect->height() / srcRect->height() * intersectRect.height() / m_bitmapRect.height());
|
| + newDstRect.moveBy(dstRect->location());
|
| + *srcRect = newSrcRect;
|
| + *dstRect = newDstRect;
|
| +}
|
| +
|
| +FloatSize ImageBitmap::sourceSize() const
|
| +{
|
| + return FloatSize(width(), height());
|
| +}
|
| +
|
| }
|
|
|