blob: b2d8cf773490ed8bac61bd791088209fd6ad7981 [file] [log] [blame]
reed@google.com5fdc9832013-07-24 15:47:52 +00001
2function sk_scrape_startcanvas(c, fileName) end
3
4function sk_scrape_endcanvas(c, fileName) end
5
commit-bot@chromium.org74f96b92013-08-01 17:32:56 +00006count3 = 0
7count3sym = 0
8
reed@google.com5fdc9832013-07-24 15:47:52 +00009function 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.org74f96b92013-08-01 17:32:56 +000016 --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.com5fdc9832013-07-24 15:47:52 +000025 end
26 end
27 end
28end
29
commit-bot@chromium.org74f96b92013-08-01 17:32:56 +000030function sk_scrape_summarize()
31 io.write("Number of 3 color gradients: ", count3, "\n");
32 io.write("Number of 3 color symmetric gradients: ", count3sym, "\n");
33end
reed@google.com5fdc9832013-07-24 15:47:52 +000034