isABitmap is deprecated, use isAImage
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2748
Change-Id: I7006a3231ff0e9e39b187deae550364bc97f49d6
Reviewed-on: https://skia-review.googlesource.com/2748
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
diff --git a/src/utils/SkLua.cpp b/src/utils/SkLua.cpp
index d9beaed..e80708c 100644
--- a/src/utils/SkLua.cpp
+++ b/src/utils/SkLua.cpp
@@ -1248,17 +1248,16 @@
return shader && shader->isOpaque();
}
-static int lshader_isABitmap(lua_State* L) {
+static int lshader_isAImage(lua_State* L) {
SkShader* shader = get_ref<SkShader>(L, 1);
if (shader) {
- SkBitmap bm;
SkMatrix matrix;
SkShader::TileMode modes[2];
- if (shader->isABitmap(&bm, &matrix, modes)) {
+ if (SkImage* image = shader->isAImage(&matrix, modes)) {
lua_newtable(L);
- setfield_number(L, "genID", bm.pixelRef() ? bm.pixelRef()->getGenerationID() : 0);
- setfield_number(L, "width", bm.width());
- setfield_number(L, "height", bm.height());
+ setfield_number(L, "id", image->uniqueID());
+ setfield_number(L, "width", image->width());
+ setfield_number(L, "height", image->height());
setfield_string(L, "tileX", mode2string(modes[0]));
setfield_string(L, "tileY", mode2string(modes[1]));
return 1;
@@ -1305,7 +1304,7 @@
static const struct luaL_Reg gSkShader_Methods[] = {
{ "isOpaque", lshader_isOpaque },
- { "isABitmap", lshader_isABitmap },
+ { "isAImage", lshader_isAImage },
{ "asAGradient", lshader_asAGradient },
{ "__gc", lshader_gc },
{ nullptr, nullptr }