reed@google.com | 312e9a2 | 2013-06-12 19:53:49 +0000 | [diff] [blame] | 1 | local canvas |
| 2 | |
| 3 | function sk_scrape_startcanvas(c, fileName) |
| 4 | canvas = c |
| 5 | end |
| 6 | |
| 7 | function sk_scrape_endcanvas(c, fileName) |
| 8 | canvas = nil |
| 9 | end |
| 10 | |
| 11 | local glyph_calls = 0 |
| 12 | local unichar_calls = 0 |
| 13 | |
| 14 | local isTextVerbs = { |
| 15 | drawPosText = true, |
| 16 | drawPosTextH = true, |
| 17 | drawText = true, |
| 18 | drawTextOnPath = true, |
| 19 | } |
| 20 | |
| 21 | function sk_scrape_accumulate(t) |
| 22 | if isTextVerbs[t.verb] then |
| 23 | if t.glyphs then |
| 24 | glyph_calls = glyph_calls + 1 |
| 25 | else |
| 26 | unichar_calls = unichar_calls + 1 |
| 27 | end |
| 28 | end |
| 29 | end |
| 30 | |
| 31 | function sk_scrape_summarize() |
| 32 | io.write("glyph calls = ", glyph_calls, |
| 33 | ", unichar calls = ", unichar_calls, "\n"); |
| 34 | end |
| 35 | |