Chromium Code Reviews| 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 bb45b3f009b97649d272ffb1158c13e864aee62a..f753e04be66c1919441c75767caa10c8f83e9a3d 100644 |
| --- a/third_party/WebKit/Source/core/frame/ImageBitmap.cpp |
| +++ b/third_party/WebKit/Source/core/frame/ImageBitmap.cpp |
| @@ -181,6 +181,27 @@ PassRefPtrWillBeRawPtr<ImageBitmap> ImageBitmap::create(Image* image, const IntR |
| return adoptRefWillBeNoop(new ImageBitmap(image, normalizedCropRect)); |
| } |
| +void ImageBitmap::neuter() |
| +{ |
| + if (m_imageElement) |
| + m_imageElement.clear(); |
| + if (m_bitmap) |
| + m_bitmap.clear(); |
| + |
| + m_isNeutered = true; |
| + |
| + m_bitmapRect.setLocation(IntPoint(0, 0)); |
|
Justin Novosad
2015/10/23 13:30:04
Setting the rects and offset to 0 is overkill.
|
| + m_bitmapRect.setSize(IntSize(0, 0)); |
| + m_cropRect = m_bitmapRect; |
| + m_bitmapOffset.setX(0); |
| + m_bitmapOffset.setY(0); |
| +} |
| + |
| +PassRefPtr<ImageBitmap> ImageBitmap::transfer() |
| +{ |
| + return adoptRef(new ImageBitmap(this, m_cropRect)); |
|
Justin Novosad
2015/10/23 13:30:04
Not oilpan compatible.
|
| +} |
| + |
| void ImageBitmap::notifyImageSourceChanged() |
| { |
| m_bitmap = cropImage(m_imageElement->cachedImage()->image(), m_cropRect); |