Chromium Code Reviews| Index: src/utils/SkLua.cpp |
| diff --git a/src/utils/SkLua.cpp b/src/utils/SkLua.cpp |
| index 48493b88a83dc6841b3175856ec7cbfd1eee411b..d41a8faaca6b3cc6f807d1c4049e5055135563e2 100644 |
| --- a/src/utils/SkLua.cpp |
| +++ b/src/utils/SkLua.cpp |
| @@ -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())); |
|
reed1
2014/09/17 20:56:51
This Create can return null. Perhaps we should che
Rémi Piotaix
2014/09/17 21:06:55
I think it is checked in SkInstallDiscardablePixel
|
| + |
| if (image) { |
| push_ref(L, image); |
| image->unref(); |