skia2/tools/lua/dump_clipstack_at_restore.lua
bsalomon@google.com 4ebe382188 Revert "Revert of Add getReducedClipStack to lua canvas (https://codereview.chromium.org/180283004/)"
This reverts commit efded03a38d6147caaf2d951638d27fdd47eed64.

Fixes builds

Review URL: https://codereview.chromium.org/181903002

git-svn-id: http://skia.googlecode.com/svn/trunk@13599 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-02-26 20:22:32 +00:00

34 lines
1.1 KiB
Lua

function sk_scrape_startcanvas(c, fileName)
canvas = c
clipstack = {}
restoreCount = 0
end
function sk_scrape_endcanvas(c, fileName)
canvas = nil
end
function sk_scrape_accumulate(t)
if (t.verb == "restore") then
restoreCount = restoreCount + 1;
-- io.write("Clip Stack at restore #", restoreCount, ":\n")
io.write("Reduced Clip Stack at restore #", restoreCount, ":\n")
for i = 1, #clipstack do
local element = clipstack[i];
io.write("\t", element["op"], ", ", element["type"], ", aa:", tostring(element["aa"]))
if (element["type"] == "path") then
io.write(", fill: ", element["path"]:getFillType())
io.write(", segments: \"", element["path"]:getSegmentTypes(), "\"")
io.write(", convex:", tostring(element["path"]:isConvex()))
end
io.write("\n")
end
io.write("\n")
else
-- clipstack = canvas:getClipStack()
clipstack = canvas:getReducedClipStack()
end
end
function sk_scrape_summarize() end