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

Unified Diff: Source/platform/exported/WebImageSkia.cpp

Issue 1008243003: Nuke NativeImageSkia -- new version. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Convert BitmapImage::createFrameAtIndex() to Skia-style 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
Index: Source/platform/exported/WebImageSkia.cpp
diff --git a/Source/platform/exported/WebImageSkia.cpp b/Source/platform/exported/WebImageSkia.cpp
index 94aac9edbfab7300112353e047da60b38d40ee6f..bab74a9957970d2020bfb6cea48f487f3ecb8bf8 100644
--- a/Source/platform/exported/WebImageSkia.cpp
+++ b/Source/platform/exported/WebImageSkia.cpp
@@ -34,7 +34,6 @@
#include "platform/SharedBuffer.h"
#include "platform/graphics/Image.h"
-#include "platform/graphics/skia/NativeImageSkia.h"
#include "platform/image-decoders/ImageDecoder.h"
#include "public/platform/WebData.h"
#include "public/platform/WebSize.h"
@@ -84,11 +83,7 @@ WebImage WebImage::fromData(const WebData& data, const WebSize& desiredSize)
if (!frame)
return WebImage();
- RefPtr<NativeImageSkia> image = frame->asNewNativeImage();
- if (!image)
- return WebImage();
-
- return WebImage(image->bitmap());
+ return WebImage(frame->bitmap());
}
WebVector<WebImage> WebImage::framesFromData(const WebData& data)
@@ -121,9 +116,9 @@ WebVector<WebImage> WebImage::framesFromData(const WebData& data)
if (!frame)
continue;
- RefPtr<NativeImageSkia> image = frame->asNewNativeImage();
- if (image && image->isDataComplete())
- frames.append(WebImage(image->bitmap()));
+ const SkBitmap& bitmap = frame->bitmap();
+ if (!bitmap.isNull() && bitmap.isImmutable())
+ frames.append(WebImage(bitmap));
}
return frames;
@@ -156,9 +151,9 @@ WebImage::WebImage(const PassRefPtr<Image>& image)
WebImage& WebImage::operator=(const PassRefPtr<Image>& image)
{
- RefPtr<NativeImageSkia> p;
- if (image && (p = image->nativeImageForCurrentFrame()))
- assign(p->bitmap());
+ SkBitmap p;
+ if (image && image->bitmapForCurrentFrame(&p))
+ assign(p);
else
reset();
return *this;

Powered by Google App Engine
This is Rietveld 408576698