reed@google.com | 5fdc983 | 2013-07-24 15:47:52 +0000 | [diff] [blame] | 1 | |
| 2 | function sk_scrape_startcanvas(c, fileName) end |
| 3 | |
| 4 | function sk_scrape_endcanvas(c, fileName) end |
| 5 | |
commit-bot@chromium.org | 74f96b9 | 2013-08-01 17:32:56 +0000 | [diff] [blame] | 6 | count3 = 0 |
| 7 | count3sym = 0 |
| 8 | |
reed@google.com | 5fdc983 | 2013-07-24 15:47:52 +0000 | [diff] [blame] | 9 | function sk_scrape_accumulate(t) |
| 10 | local p = t.paint |
| 11 | if p then |
| 12 | local s = p:getShader() |
| 13 | if s then |
| 14 | local g = s:asAGradient() |
| 15 | if g then |
commit-bot@chromium.org | 74f96b9 | 2013-08-01 17:32:56 +0000 | [diff] [blame] | 16 | --io.write(g.type, " gradient with ", g.colorCount, " colors\n") |
| 17 | |
| 18 | if g.colorCount == 3 then |
| 19 | count3 = count3 + 1 |
| 20 | |
| 21 | if (g.midPos >= 0.499 and g.midPos <= 0.501) then |
| 22 | count3sym = count3sym + 1 |
| 23 | end |
| 24 | end |
reed@google.com | 5fdc983 | 2013-07-24 15:47:52 +0000 | [diff] [blame] | 25 | end |
| 26 | end |
| 27 | end |
| 28 | end |
| 29 | |
commit-bot@chromium.org | 74f96b9 | 2013-08-01 17:32:56 +0000 | [diff] [blame] | 30 | function sk_scrape_summarize() |
| 31 | io.write("Number of 3 color gradients: ", count3, "\n"); |
| 32 | io.write("Number of 3 color symmetric gradients: ", count3sym, "\n"); |
| 33 | end |
reed@google.com | 5fdc983 | 2013-07-24 15:47:52 +0000 | [diff] [blame] | 34 | |