| Index: third_party/WebKit/Source/core/frame/ImageBitmap.cpp
|
| diff --git a/third_party/WebKit/Source/core/frame/ImageBitmap.cpp b/third_party/WebKit/Source/core/frame/ImageBitmap.cpp
|
| index 4c125cbc7f246cfec5f5c2638225402edbaee884..51db3cbd6de58e5ee1b7222594a4cad037315451 100644
|
| --- a/third_party/WebKit/Source/core/frame/ImageBitmap.cpp
|
| +++ b/third_party/WebKit/Source/core/frame/ImageBitmap.cpp
|
| @@ -46,12 +46,13 @@ static PassRefPtr<StaticBitmapImage> cropImage(Image* image, const IntRect& crop
|
| return StaticBitmapImage::create(adoptRef(surface->newImageSnapshot()));
|
| }
|
|
|
| -ImageBitmap::ImageBitmap(HTMLImageElement* image, const IntRect& cropRect)
|
| +ImageBitmap::ImageBitmap(HTMLImageElement* image, const IntRect& cropRect, bool originCleanFlag)
|
| {
|
| + m_isOriginClean = originCleanFlag;
|
| m_image = cropImage(image->cachedImage()->image(), cropRect);
|
| }
|
|
|
| -ImageBitmap::ImageBitmap(HTMLVideoElement* video, const IntRect& cropRect)
|
| +ImageBitmap::ImageBitmap(HTMLVideoElement* video, const IntRect& cropRect, bool originCleanFlag)
|
| {
|
| IntSize playerSize;
|
| if (video->webMediaPlayer())
|
| @@ -65,6 +66,7 @@ ImageBitmap::ImageBitmap(HTMLVideoElement* video, const IntRect& cropRect)
|
|
|
| IntPoint dstPoint = IntPoint(std::max(0, -cropRect.x()), std::max(0, -cropRect.y()));
|
| video->paintCurrentFrame(buffer->canvas(), IntRect(dstPoint, srcRect.size()), nullptr);
|
| + m_isOriginClean = originCleanFlag;
|
| m_image = StaticBitmapImage::create(buffer->newSkImageSnapshot(PreferNoAcceleration));
|
| }
|
|
|
| @@ -122,16 +124,16 @@ ImageBitmap::~ImageBitmap()
|
| {
|
| }
|
|
|
| -PassRefPtrWillBeRawPtr<ImageBitmap> ImageBitmap::create(HTMLImageElement* image, const IntRect& cropRect)
|
| +PassRefPtrWillBeRawPtr<ImageBitmap> ImageBitmap::create(HTMLImageElement* image, const IntRect& cropRect, bool originCleanFlag)
|
| {
|
| IntRect normalizedCropRect = normalizeRect(cropRect);
|
| - return adoptRefWillBeNoop(new ImageBitmap(image, normalizedCropRect));
|
| + return adoptRefWillBeNoop(new ImageBitmap(image, normalizedCropRect, originCleanFlag));
|
| }
|
|
|
| -PassRefPtrWillBeRawPtr<ImageBitmap> ImageBitmap::create(HTMLVideoElement* video, const IntRect& cropRect)
|
| +PassRefPtrWillBeRawPtr<ImageBitmap> ImageBitmap::create(HTMLVideoElement* video, const IntRect& cropRect, bool originCleanFlag)
|
| {
|
| IntRect normalizedCropRect = normalizeRect(cropRect);
|
| - return adoptRefWillBeNoop(new ImageBitmap(video, normalizedCropRect));
|
| + return adoptRefWillBeNoop(new ImageBitmap(video, normalizedCropRect, originCleanFlag));
|
| }
|
|
|
| PassRefPtrWillBeRawPtr<ImageBitmap> ImageBitmap::create(HTMLCanvasElement* canvas, const IntRect& cropRect)
|
|
|