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

Unified Diff: Source/core/frame/ImageBitmap.cpp

Issue 1008243003: Nuke NativeImageSkia -- new version. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add more WARN_UNUSED_RETURN goodness Created 5 years, 9 months 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 | « Source/core/fetch/ImageResource.cpp ('k') | Source/core/frame/ImageBitmapTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/frame/ImageBitmap.cpp
diff --git a/Source/core/frame/ImageBitmap.cpp b/Source/core/frame/ImageBitmap.cpp
index 14c58ad575d0b86a9c9a2dda48082d9a8523002b..dedd174094aad7173530df21c466eb98949b275b 100644
--- a/Source/core/frame/ImageBitmap.cpp
+++ b/Source/core/frame/ImageBitmap.cpp
@@ -31,9 +31,13 @@ static inline PassRefPtr<Image> cropImage(Image* image, const IntRect& cropRect)
if (!intersectRect.width() || !intersectRect.height())
return nullptr;
+ SkBitmap bitmap;
+ if (!image->bitmapForCurrentFrame(&bitmap))
+ return nullptr;
+
SkBitmap cropped;
- image->nativeImageForCurrentFrame()->bitmap().extractSubset(&cropped, intersectRect);
- return BitmapImage::create(NativeImageSkia::create(cropped));
+ bitmap.extractSubset(&cropped, intersectRect);
+ return BitmapImage::create(cropped);
}
ImageBitmap::ImageBitmap(HTMLImageElement* image, const IntRect& cropRect)
« no previous file with comments | « Source/core/fetch/ImageResource.cpp ('k') | Source/core/frame/ImageBitmapTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698