| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #include "SkLuaCanvas.h" | 8 #include "SkLuaCanvas.h" |
| 9 #include "SkLua.h" | 9 #include "SkLua.h" |
| 10 | 10 |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 } | 66 } |
| 67 | 67 |
| 68 /////////////////////////////////////////////////////////////////////////////// | 68 /////////////////////////////////////////////////////////////////////////////// |
| 69 | 69 |
| 70 void SkLuaCanvas::pushThis() { | 70 void SkLuaCanvas::pushThis() { |
| 71 SkLua(fL).pushCanvas(this); | 71 SkLua(fL).pushCanvas(this); |
| 72 } | 72 } |
| 73 | 73 |
| 74 /////////////////////////////////////////////////////////////////////////////// | 74 /////////////////////////////////////////////////////////////////////////////// |
| 75 | 75 |
| 76 static SkBitmap make_bm(int width, int height) { | |
| 77 SkBitmap bm; | |
| 78 bm.setConfig(SkBitmap::kNo_Config, width, height); | |
| 79 return bm; | |
| 80 } | |
| 81 | |
| 82 SkLuaCanvas::SkLuaCanvas(int width, int height, lua_State* L, const char func[]) | 76 SkLuaCanvas::SkLuaCanvas(int width, int height, lua_State* L, const char func[]) |
| 83 : INHERITED(make_bm(width, height)) | 77 : INHERITED(width, height) |
| 84 , fL(L) | 78 , fL(L) |
| 85 , fFunc(func) { | 79 , fFunc(func) { |
| 86 } | 80 } |
| 87 | 81 |
| 88 SkLuaCanvas::~SkLuaCanvas() {} | 82 SkLuaCanvas::~SkLuaCanvas() {} |
| 89 | 83 |
| 90 int SkLuaCanvas::save(SaveFlags flags) { | 84 int SkLuaCanvas::save(SaveFlags flags) { |
| 91 AUTO_LUA("save"); | 85 AUTO_LUA("save"); |
| 92 return this->INHERITED::save(flags); | 86 return this->INHERITED::save(flags); |
| 93 } | 87 } |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 const SkColor colors[], SkXfermode* xmode, | 275 const SkColor colors[], SkXfermode* xmode, |
| 282 const uint16_t indices[], int indexCount, | 276 const uint16_t indices[], int indexCount, |
| 283 const SkPaint& paint) { | 277 const SkPaint& paint) { |
| 284 AUTO_LUA("drawVertices"); | 278 AUTO_LUA("drawVertices"); |
| 285 lua.pushPaint(paint, "paint"); | 279 lua.pushPaint(paint, "paint"); |
| 286 } | 280 } |
| 287 | 281 |
| 288 void SkLuaCanvas::drawData(const void* data, size_t length) { | 282 void SkLuaCanvas::drawData(const void* data, size_t length) { |
| 289 AUTO_LUA("drawData"); | 283 AUTO_LUA("drawData"); |
| 290 } | 284 } |
| OLD | NEW |