add counting to Globals, and refactor some for clarity

BUG=

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

git-svn-id: http://skia.googlecode.com/svn/trunk@11484 2bbb7eff-a529-9590-31e7-b0007b416f81
5 files changed