From 016e51fb06d9ac6e57065d79032ba50008b77331 Mon Sep 17 00:00:00 2001 From: fmenozzi Date: Thu, 14 Jul 2016 07:44:50 -0700 Subject: Add verb field in scraping scripts BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2150663002 Review-Url: https://codereview.chromium.org/2150663002 --- tools/lua/gradients.lua | 14 ++++++++++++-- tools/lua/gradients.py | 3 ++- 2 files changed, 14 insertions(+), 3 deletions(-) (limited to 'tools/lua') diff --git a/tools/lua/gradients.lua b/tools/lua/gradients.lua index 4e24c9694a..2a14ff637b 100644 --- a/tools/lua/gradients.lua +++ b/tools/lua/gradients.lua @@ -7,6 +7,7 @@ function LuaDoubleNearlyEqual(a, b) return math.abs(a-b) <= LuaDoubleNearlyZero end +verbs = {} gradients = {} i = 1 @@ -18,6 +19,12 @@ function sk_scrape_accumulate(t) if s then local g = s:asAGradient() if g then + if verbs[t.verb] then + verbs[t.verb] = verbs[t.verb] + 1 + else + verbs[t.verb] = 1 + end + gradients[i] = {} gradients[i].colorCount = g.colorCount @@ -38,8 +45,10 @@ function sk_scrape_accumulate(t) numHardStops = numHardStops + 1 end end - gradients[i].numHardStops = numHardStops; + gradients[i].numHardStops = numHardStops + gradients[i].verb = t.verb + gradients[i].positions = {} for j = 1, g.colorCount, 1 do gradients[i].positions[j] = g.positions[j] @@ -61,12 +70,13 @@ function sk_scrape_summarize() end end - io.write(string.format("%d %s %s %d %d %s\n", + io.write(string.format("%d %s %s %d %d %s %s\n", v.colorCount, v.type, v.tile, tonumber(v.isEvenlySpaced and 1 or 0), v.numHardStops, + v.verb, pos)) end end diff --git a/tools/lua/gradients.py b/tools/lua/gradients.py index f3dd13619f..0fa4c49775 100755 --- a/tools/lua/gradients.py +++ b/tools/lua/gradients.py @@ -17,6 +17,7 @@ def create_database(inpath, outpath): TileMode TEXT, EvenlySpaced INTEGER, HardStopCount INTEGER, + Verb TEXT, Positions TEXT )'''); c.execute("DELETE FROM gradients"); @@ -26,7 +27,7 @@ def create_database(inpath, outpath): for line in [line.strip() for line in results]: gradients.append(line.split()); - c.executemany("INSERT INTO gradients VALUES (?, ?, ?, ?, ?, ?)", + c.executemany("INSERT INTO gradients VALUES (?, ?, ?, ?, ?, ?, ?)", gradients); conn.commit(); -- cgit v1.2.3