Use SkImage::NewFromGenerator() instead of SkImage::newEncodedData()

BUG=skia:2948
R=junov@chromium.org, reed@google.com

Author: piotaixr@chromium.org

Review URL: https://codereview.chromium.org/575173002
This commit is contained in:
piotaixr 2014-09-17 14:33:30 -07:00 committed by Commit bot
parent 7b433f15de
commit 4bcc2021ff

View File

@ -13,6 +13,7 @@
#include "SkCanvas.h"
#include "SkData.h"
#include "SkDecodingImageGenerator.h"
#include "SkDocument.h"
#include "SkImage.h"
#include "SkMatrix.h"
@ -1460,7 +1461,9 @@ static int lsk_loadImage(lua_State* L) {
const char* name = lua_tolstring(L, 1, NULL);
SkAutoDataUnref data(SkData::NewFromFileName(name));
if (data.get()) {
SkImage* image = SkImage::NewEncodedData(data.get());
SkImage* image = SkImage::NewFromGenerator(
SkDecodingImageGenerator::Create(data, SkDecodingImageGenerator::Options()));
if (image) {
push_ref(L, image);
image->unref();