change typeface::purgeall to not assume that the array is empty, as it may
authorreed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Fri, 16 Dec 2011 17:56:23 +0000 (17:56 +0000)
committerreed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Fri, 16 Dec 2011 17:56:23 +0000 (17:56 +0000)
commit538f784e3d9b898ff90de9d766eddb9fa38f4a43
tree27a8dbd742b24a8df7bd2ae1e33a04fff25e2ffb
parentf86ab8472e8bb4017f32f8e6f36a0001ceb39b46
change typeface::purgeall to not assume that the array is empty, as it may
contain typefaces that still are referenced.

change SkTypeface::UniqueID to internally hold onto a reference to the default
typeface, so that it will always be available if the font cache tries to resolve
it. Then general rule being: if we have a fontID specified by SkPaint, then its
associated typeface object must be alive.

git-svn-id: http://skia.googlecode.com/svn/trunk@2889 2bbb7eff-a529-9590-31e7-b0007b416f81
src/core/SkTypeface.cpp
src/core/SkTypefaceCache.cpp