switch to typeface api for tables
authorreed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Thu, 21 Mar 2013 21:43:51 +0000 (21:43 +0000)
committerreed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Thu, 21 Mar 2013 21:43:51 +0000 (21:43 +0000)
git-svn-id: http://skia.googlecode.com/svn/trunk@8317 2bbb7eff-a529-9590-31e7-b0007b416f81

src/device/xps/SkXPSDevice.cpp

index f0afe69..ddd4a0d 100644 (file)
@@ -37,6 +37,7 @@
 #include "SkTDArray.h"
 #include "SkTLazy.h"
 #include "SkTScopedComPtr.h"
+#include "SkTypefacePriv.h"
 #include "SkUtils.h"
 #include "SkXPSDevice.h"
 
@@ -2013,10 +2014,10 @@ void SkXPSDevice::drawSprite(const SkDraw&, const SkBitmap& bitmap,
 
 HRESULT SkXPSDevice::CreateTypefaceUse(const SkPaint& paint,
                                        TypefaceUse** typefaceUse) {
-    const SkTypeface* typeface = paint.getTypeface();
+    SkAutoResolveDefaultTypeface typeface(paint.getTypeface());
 
     //Check cache.
-    const SkFontID typefaceID = SkTypeface::UniqueID(typeface);
+    const SkFontID typefaceID = typeface->uniqueID();
     if (!this->fTypefaces.empty()) {
         TypefaceUse* current = &this->fTypefaces.front();
         const TypefaceUse* last = &this->fTypefaces.back();
@@ -2033,7 +2034,7 @@ HRESULT SkXPSDevice::CreateTypefaceUse(const SkPaint& paint,
     XPS_FONT_EMBEDDING embedding = XPS_FONT_EMBEDDING_RESTRICTED;
 
     SkTScopedComPtr<IStream> fontStream;
-    SkStream* fontData = SkFontHost::OpenStream(typefaceID);
+    SkStream* fontData = typeface->openStream(NULL);
     HRM(SkIStream::CreateFromSkStream(fontData, true, &fontStream),
         "Could not create font stream.");