aboutsummaryrefslogtreecommitdiffhomepage
path: root/samplecode
diff options
context:
space:
mode:
authorGravatar Florin Malita <fmalita@chromium.org>2017-12-11 11:48:29 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-12-11 17:15:40 +0000
commitba19b6f219d21ec0370830e90583cc55dfd0e48d (patch)
tree8f50f3217d0b9888c3b10085f432283a8f66b47b /samplecode
parent80fc07e8f854cd7c632bc06443d5f120ed002524 (diff)
Fix SampleLua build
Change-Id: Ie0114ab16b99aed4343f6255dbc86fb15554ea74 Reviewed-on: https://skia-review.googlesource.com/83380 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Florin Malita <fmalita@chromium.org>
Diffstat (limited to 'samplecode')
-rw-r--r--samplecode/SampleLua.cpp17
1 files changed, 1 insertions, 16 deletions
diff --git a/samplecode/SampleLua.cpp b/samplecode/SampleLua.cpp
index 848a942e00..2c94e81f76 100644
--- a/samplecode/SampleLua.cpp
+++ b/samplecode/SampleLua.cpp
@@ -25,8 +25,6 @@ static const char gDrawName[] = "onDrawContent";
static const char gClickName[] = "onClickHandler";
static const char gUnicharName[] = "onCharHandler";
-static const char gLuaClickHandlerName[] = "lua-click-handler";
-
static const char gMissingCode[] = ""
"local paint = Sk.newPaint()"
"paint:setAntiAlias(true)"
@@ -89,7 +87,6 @@ protected:
SkDebugf("lua err: %s\n", lua_tostring(L, -1));
} else {
if (lua_isboolean(L, -1) && lua_toboolean(L, -1)) {
- this->inval(nullptr);
return true;
}
}
@@ -114,10 +111,6 @@ protected:
fLua->pushScalar(this->height());
if (lua_pcall(L, 3, 1, 0) != LUA_OK) {
SkDebugf("lua err: %s\n", lua_tostring(L, -1));
- } else {
- if (lua_isboolean(L, -1) && lua_toboolean(L, -1)) {
- this->inval(nullptr);
- }
}
}
}
@@ -134,10 +127,7 @@ protected:
SkDebugf("lua err: %s\n", lua_tostring(L, -1));
} else {
if (lua_isboolean(L, -1) && lua_toboolean(L, -1)) {
- this->inval(nullptr);
- Click* c = new Click(this);
- c->setType(gLuaClickHandlerName);
- return c;
+ return new Click(this);
}
}
}
@@ -145,10 +135,6 @@ protected:
}
bool onClick(Click* click) override {
- if (click->getType() != gLuaClickHandlerName) {
- return this->INHERITED::onClick(click);
- }
-
const char* state = nullptr;
switch (click->fState) {
case Click::kMoved_State:
@@ -161,7 +147,6 @@ protected:
break;
}
if (state) {
- this->inval(nullptr);
lua_State* L = fLua->get();
lua_getglobal(L, gClickName);
fLua->pushScalar(click->fCurr.x());