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:
parent
7b433f15de
commit
4bcc2021ff
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user