Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(58)

Unified Diff: tools/lua/paths.lua

Issue 475433004: Add scraper to find paths that fallback to software (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tools/lua/paths_agg.lua » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/lua/paths.lua
diff --git a/tools/lua/paths.lua b/tools/lua/paths.lua
new file mode 100644
index 0000000000000000000000000000000000000000..9ade7e55148ed2a6c7feb253e8c5be857b0ab956
--- /dev/null
+++ b/tools/lua/paths.lua
@@ -0,0 +1,64 @@
+function sk_scrape_startcanvas(c, fileName) end
robertphillips 2014/08/15 12:34:18 Comment up here about what this tracks and why ??
krajcevski 2014/08/15 15:13:52 Done.
+
+function sk_scrape_endcanvas(c, fileName) end
+
+draws = 0
+drawPaths = 0
+drawPathsAnti = 0
+drawPathsConvex = 0
+drawPathsConvexAnti = 0
+
+function string.starts(String,Start)
+ return string.sub(String,1,string.len(Start))==Start
+end
+
+function updatePathVars(path, isAntiAlias)
+ if not path then
+ return
+ end
+
+ if path:isEmpty() then
+ return
+ end
+
+ if path:isRect() then
+ return
+ end
+
+ drawPaths = drawPaths + 1
+ if isAntiAlias then
+ drawPathsAnti = drawPathsAnti + 1
+ end
+
+ if path:isConvex() then
+ drawPathsConvex = drawPathsConvex + 1
+ if isAntiAlias then
+ drawPathsConvexAnti = drawPathsConvexAnti + 1
+ end
+ end
+end
+
+function sk_scrape_accumulate(t)
+ if (string.starts(t.verb, "draw")) then
+ draws = draws + 1
+ end
+
robertphillips 2014/08/15 12:34:18 if (string.starts(t.verb, "clip")) then clips
krajcevski 2014/08/15 15:13:52 Done.
+ if t.verb == "clipPath" then
+ local path = t.path
+ local antiAlias = t.aa
+ updatePathVars(path, antiAlias)
+ end
+
+ if t.verb == "drawPath" then
+ local paint = t.paint
+ local path = t.path
+ updatePathVars(path, paint:isAntiAlias())
+ end
+end
+
+function sk_scrape_summarize()
+ local swPaths = drawPathsAnti - drawPathsConvexAnti
+ io.write("\ndraws = draws + ", draws, "\n");
+ io.write("\ndrawPaths = drawPaths + ", drawPaths, "\n");
+ io.write("\nswPaths = swPaths + ", swPaths, "\n");
+end
« no previous file with comments | « no previous file | tools/lua/paths_agg.lua » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698