From f023e6879c63e5d223e89707a714f18688a93a4a Mon Sep 17 00:00:00 2001 From: fmenozzi Date: Mon, 18 Jul 2016 08:20:06 -0700 Subject: [PATCH] Add filename to gradient scrape BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2160583002 Review-Url: https://codereview.chromium.org/2160583002 --- tools/lua/gradients.lua | 16 +++++++++++++--- tools/lua/gradients.py | 6 ++++-- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/tools/lua/gradients.lua b/tools/lua/gradients.lua index 2a14ff637b..833b8b9ca1 100644 --- a/tools/lua/gradients.lua +++ b/tools/lua/gradients.lua @@ -1,5 +1,12 @@ -function sk_scrape_startcanvas(c, fileName) end -function sk_scrape_endcanvas(c, fileName) end +filename = "" + +function sk_scrape_startcanvas(c, fileName) + filename = fileName +end + +function sk_scrape_endcanvas(c, fileName) + +end LuaDoubleNearlyZero = 1.0 / bit32.lshift(1.0, 12) @@ -27,6 +34,8 @@ function sk_scrape_accumulate(t) gradients[i] = {} + gradients[i].filename = filename + gradients[i].colorCount = g.colorCount gradients[i].type = g.type gradients[i].tile = g.tile @@ -70,7 +79,8 @@ function sk_scrape_summarize() end end - io.write(string.format("%d %s %s %d %d %s %s\n", + io.write(string.format("%s %d %s %s %d %d %s %s\n", + v.filename, v.colorCount, v.type, v.tile, diff --git a/tools/lua/gradients.py b/tools/lua/gradients.py index 0fa4c49775..65ced5e854 100755 --- a/tools/lua/gradients.py +++ b/tools/lua/gradients.py @@ -12,6 +12,7 @@ def create_database(inpath, outpath): with sqlite3.connect(outpath) as conn: c = conn.cursor(); c.execute('''CREATE TABLE IF NOT EXISTS gradients ( + FileName TEXT, ColorCount INTEGER, GradientType TEXT, TileMode TEXT, @@ -27,8 +28,9 @@ def create_database(inpath, outpath): for line in [line.strip() for line in results]: gradients.append(line.split()); - c.executemany("INSERT INTO gradients VALUES (?, ?, ?, ?, ?, ?, ?)", - gradients); + c.executemany( + "INSERT INTO gradients VALUES (?, ?, ?, ?, ?, ?, ?, ?)", + gradients); conn.commit();