Add filename to gradient scrape

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2160583002

Review-Url: https://codereview.chromium.org/2160583002
This commit is contained in:
fmenozzi 2016-07-18 08:20:06 -07:00 committed by Commit bot
parent eb9a84aa57
commit f023e6879c
2 changed files with 17 additions and 5 deletions

View File

@ -1,5 +1,12 @@
function sk_scrape_startcanvas(c, fileName) end filename = ""
function sk_scrape_endcanvas(c, fileName) end
function sk_scrape_startcanvas(c, fileName)
filename = fileName
end
function sk_scrape_endcanvas(c, fileName)
end
LuaDoubleNearlyZero = 1.0 / bit32.lshift(1.0, 12) LuaDoubleNearlyZero = 1.0 / bit32.lshift(1.0, 12)
@ -27,6 +34,8 @@ function sk_scrape_accumulate(t)
gradients[i] = {} gradients[i] = {}
gradients[i].filename = filename
gradients[i].colorCount = g.colorCount gradients[i].colorCount = g.colorCount
gradients[i].type = g.type gradients[i].type = g.type
gradients[i].tile = g.tile gradients[i].tile = g.tile
@ -70,7 +79,8 @@ function sk_scrape_summarize()
end end
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.colorCount,
v.type, v.type,
v.tile, v.tile,

View File

@ -12,6 +12,7 @@ def create_database(inpath, outpath):
with sqlite3.connect(outpath) as conn: with sqlite3.connect(outpath) as conn:
c = conn.cursor(); c = conn.cursor();
c.execute('''CREATE TABLE IF NOT EXISTS gradients ( c.execute('''CREATE TABLE IF NOT EXISTS gradients (
FileName TEXT,
ColorCount INTEGER, ColorCount INTEGER,
GradientType TEXT, GradientType TEXT,
TileMode TEXT, TileMode TEXT,
@ -27,7 +28,8 @@ def create_database(inpath, outpath):
for line in [line.strip() for line in results]: for line in [line.strip() for line in results]:
gradients.append(line.split()); gradients.append(line.split());
c.executemany("INSERT INTO gradients VALUES (?, ?, ?, ?, ?, ?, ?)", c.executemany(
"INSERT INTO gradients VALUES (?, ?, ?, ?, ?, ?, ?, ?)",
gradients); gradients);
conn.commit(); conn.commit();