Add filename to gradient scrape
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2160583002
Review-Url: https://codereview.chromium.org/2160583002
diff --git a/tools/lua/gradients.lua b/tools/lua/gradients.lua
index 2a14ff6..833b8b9 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 @@
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 @@
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 0fa4c49..65ced5e 100755
--- a/tools/lua/gradients.py
+++ b/tools/lua/gradients.py
@@ -12,6 +12,7 @@
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 @@
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();