From bdc49ae0d422b8fe1957af570c4f4e63272f5285 Mon Sep 17 00:00:00 2001 From: reed Date: Tue, 14 Oct 2014 09:34:52 -0700 Subject: create and modify matrices in lua BUG=skia: Review URL: https://codereview.chromium.org/651823004 --- samplecode/SampleLua.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'samplecode/SampleLua.cpp') diff --git a/samplecode/SampleLua.cpp b/samplecode/SampleLua.cpp index 1536ed4fb8..7825ecaf69 100644 --- a/samplecode/SampleLua.cpp +++ b/samplecode/SampleLua.cpp @@ -100,12 +100,6 @@ protected: } virtual void onDrawContent(SkCanvas* canvas) SK_OVERRIDE { - SkMatrix matrix; - matrix.setRectToRect(SkRect::MakeWH(640, 480), - SkRect::MakeWH(this->width(), this->height()), - SkMatrix::kCenter_ScaleToFit); - canvas->concat(matrix); - lua_State* L = this->ensureLua(); lua_getglobal(L, gDrawName); @@ -117,7 +111,9 @@ protected: // does it make sense to try to "cache" the lua version of this // canvas between draws? fLua->pushCanvas(canvas); - if (lua_pcall(L, 1, 1, 0) != LUA_OK) { + fLua->pushScalar(this->width()); + 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)) { -- cgit v1.2.3