aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools
diff options
context:
space:
mode:
authorGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-07-24 15:47:52 +0000
committerGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-07-24 15:47:52 +0000
commit5fdc983f58098e5c9fbdbedc7719f87e5efa4d31 (patch)
treea07c3fdd4e9afd74a2604d6f313e2f891f244966 /tools
parent27e1c0070d29c36a59f4cdf323ef9a4fcd88d7e2 (diff)
expose shaders
git-svn-id: http://skia.googlecode.com/svn/trunk@10312 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'tools')
-rw-r--r--tools/lua/gradients.lua44
1 files changed, 44 insertions, 0 deletions
diff --git a/tools/lua/gradients.lua b/tools/lua/gradients.lua
new file mode 100644
index 0000000000..3ae08d50db
--- /dev/null
+++ b/tools/lua/gradients.lua
@@ -0,0 +1,44 @@
+function tostr(t)
+ local str = ""
+ for k, v in next, t do
+ if #str > 0 then
+ str = str .. ", "
+ end
+ if type(k) == "number" then
+ str = str .. "[" .. k .. "] = "
+ else
+ str = str .. tostring(k) .. " = "
+ end
+ if type(v) == "table" then
+ str = str .. "{ " .. tostr(v) .. " }"
+ else
+ str = str .. tostring(v)
+ end
+ end
+ return str
+end
+
+function sk_scrape_startcanvas(c, fileName) end
+
+function sk_scrape_endcanvas(c, fileName) end
+
+function sk_scrape_accumulate(t)
+ local p = t.paint
+ if p then
+ local s = p:getShader()
+ if s then
+ local g = s:asAGradient()
+ if g then
+ io.write(g.type, " gradient with ", g.colorCount, " colors\n")
+ else
+ local b = s:asABitmap()
+ if b then
+ io.write("bitmap ", b.genID, " width=", b.width, " height=", b.height, "\n")
+ end
+ end
+ end
+ end
+end
+
+function sk_scrape_summarize() end
+