aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/lua/dump_clipstack_at_restore.lua
blob: 4691b5b250720fd6c906b3b9958cda7c14d3d8e9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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")
        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()
    end
end

function sk_scrape_summarize() end