aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools
diff options
context:
space:
mode:
authorGravatar humper@google.com <humper@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-07-26 15:23:43 +0000
committerGravatar humper@google.com <humper@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-07-26 15:23:43 +0000
commit0f48ee0a07aa50ab60bfff3c2718b9649e3639ea (patch)
tree4876c68ff0988e2284eb7e67542b98cb57a095ed /tools
parentc074ff502096814dfc54e986077e7f1a78ed688b (diff)
add more stats to the bitmap matrix locator
BUG= R=reed@google.com Review URL: https://codereview.chromium.org/19091006 git-svn-id: http://skia.googlecode.com/svn/trunk@10392 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'tools')
-rw-r--r--tools/lua/bitmap_statistics.lua (renamed from tools/lua/find_rotated_bitmaps.lua)29
1 files changed, 8 insertions, 21 deletions
diff --git a/tools/lua/find_rotated_bitmaps.lua b/tools/lua/bitmap_statistics.lua
index bb5dc7202c..4ac8d9385f 100644
--- a/tools/lua/find_rotated_bitmaps.lua
+++ b/tools/lua/bitmap_statistics.lua
@@ -6,32 +6,14 @@ function string.endsWith(String,End)
return End=='' or string.sub(String,-string.len(End))==End
end
-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
-
local canvas = nil
local num_perspective_bitmaps = 0
local num_affine_bitmaps = 0
local num_scaled_bitmaps = 0
local num_translated_bitmaps = 0
local num_identity_bitmaps = 0
+local num_scaled_up = 0
+local num_scaled_down = 0
function sk_scrape_startcanvas(c, fileName)
canvas = c
@@ -53,6 +35,11 @@ function sk_scrape_accumulate(t)
num_affine_bitmaps = num_affine_bitmaps + 1
elseif matrixType.scale then
num_scaled_bitmaps = num_scaled_bitmaps + 1
+ if matrix:getScaleX() > 1 or matrix:getScaleY() > 1 then
+ num_scaled_up = num_scaled_up + 1
+ else
+ num_scaled_down = num_scaled_down + 1
+ end
elseif matrixType.translate then
num_translated_bitmaps = num_translated_bitmaps + 1
else
@@ -64,7 +51,7 @@ end
function sk_scrape_summarize()
io.write( "identity = ", num_identity_bitmaps,
", translated = ", num_translated_bitmaps,
- ", scaled = ", num_scaled_bitmaps,
+ ", scaled = ", num_scaled_bitmaps, " (up = ", num_scaled_up, "; down = ", num_scaled_down, ")",
", affine = ", num_affine_bitmaps,
", perspective = ", num_perspective_bitmaps,
"\n")