aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/lua
diff options
context:
space:
mode:
authorGravatar robertphillips <robertphillips@google.com>2016-01-21 09:05:32 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2016-01-21 09:05:32 -0800
commit233bab918f1ca44c260b1481b79d9fa5951186e2 (patch)
tree3a3011b48aed259bcc5a5efe87c5eaabe11466c8 /tools/lua
parentbe1d55514b512b800d30bee282505eddfc4c8660 (diff)
Add Lua SkXfermode skp scraping support
This is to answer the question of do any of our skps have SkLerpXfermodes. AFAICT they should not so this is just to verify. The only controversial part of this is the addition of 'getLuaName' to SkXfermode GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1614923002 Review URL: https://codereview.chromium.org/1614923002
Diffstat (limited to 'tools/lua')
-rw-r--r--tools/lua/xfer-counter.lua40
1 files changed, 40 insertions, 0 deletions
diff --git a/tools/lua/xfer-counter.lua b/tools/lua/xfer-counter.lua
new file mode 100644
index 0000000000..c9d659ceb0
--- /dev/null
+++ b/tools/lua/xfer-counter.lua
@@ -0,0 +1,40 @@
+
+function sk_scrape_startcanvas(c, fileName)
+end
+
+function sk_scrape_endcanvas(c, fileName)
+end
+
+local gXM_Count = 0
+local gXferModeTab = {}
+
+function sk_scrape_accumulate(t)
+ if not t.paint then
+ return
+ end
+
+ local xferMode = t.paint:getXfermode()
+
+ if xferMode then
+ local modeName = xferMode:getTypeName()
+
+ if gXferModeTab[modeName] == nil then
+ gXferModeTab[modeName] = 1;
+ else
+ gXferModeTab[modeName] = gXferModeTab[modeName] + 1
+ end
+ gXM_Count = gXM_Count + 1
+ end
+end
+
+function sk_scrape_summarize()
+ for key,value in pairs(gXferModeTab) do
+ io.write(key, ": ", value, "\n")
+ end
+ io.write("total: ", gXM_Count)
+end
+
+function test_summary()
+ io.write("just testing test_summary\n")
+end
+