| reed@google.com | 5fdc983 | 2013-07-24 15:47:52 +0000 | [diff] [blame^] | 1 | function tostr(t) |
| 2 | local str = "" |
| 3 | for k, v in next, t do |
| 4 | if #str > 0 then |
| 5 | str = str .. ", " |
| 6 | end |
| 7 | if type(k) == "number" then |
| 8 | str = str .. "[" .. k .. "] = " |
| 9 | else |
| 10 | str = str .. tostring(k) .. " = " |
| 11 | end |
| 12 | if type(v) == "table" then |
| 13 | str = str .. "{ " .. tostr(v) .. " }" |
| 14 | else |
| 15 | str = str .. tostring(v) |
| 16 | end |
| 17 | end |
| 18 | return str |
| 19 | end |
| 20 | |
| 21 | function sk_scrape_startcanvas(c, fileName) end |
| 22 | |
| 23 | function sk_scrape_endcanvas(c, fileName) end |
| 24 | |
| 25 | function sk_scrape_accumulate(t) |
| 26 | local p = t.paint |
| 27 | if p then |
| 28 | local s = p:getShader() |
| 29 | if s then |
| 30 | local g = s:asAGradient() |
| 31 | if g then |
| 32 | io.write(g.type, " gradient with ", g.colorCount, " colors\n") |
| 33 | else |
| 34 | local b = s:asABitmap() |
| 35 | if b then |
| 36 | io.write("bitmap ", b.genID, " width=", b.width, " height=", b.height, "\n") |
| 37 | end |
| 38 | end |
| 39 | end |
| 40 | end |
| 41 | end |
| 42 | |
| 43 | function sk_scrape_summarize() end |
| 44 | |