aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/FontHostStreamTest.cpp
diff options
context:
space:
mode:
authorGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-03-14 15:04:57 +0000
committerGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-03-14 15:04:57 +0000
commitfed86bdb8b9f037439bbfa7cdbd53a581dbc5985 (patch)
treeb03a35f11ee303aed8cd9c3c6210b22ba463c2dc /tests/FontHostStreamTest.cpp
parenta936e37cc76614868f5b489395bceeb340cc04cd (diff)
move most of SkFontHost to private (preceeding making it all private)
In this change, have to accomodate PDF wanting to call openStream and advancedMetrics Review URL: https://codereview.chromium.org/12739006 git-svn-id: http://skia.googlecode.com/svn/trunk@8156 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'tests/FontHostStreamTest.cpp')
-rw-r--r--tests/FontHostStreamTest.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/tests/FontHostStreamTest.cpp b/tests/FontHostStreamTest.cpp
index bbf1a03ef3..4fd88cc4da 100644
--- a/tests/FontHostStreamTest.cpp
+++ b/tests/FontHostStreamTest.cpp
@@ -91,8 +91,13 @@ static void test_fontHostStream(skiatest::Reporter* reporter) {
origCanvas.drawText("A", 1, point.fX, point.fY, paint);
SkTypeface* origTypeface = paint.getTypeface();
- const SkFontID typefaceID = SkTypeface::UniqueID(origTypeface);
- SkStream* fontData = SkFontHost::OpenStream(typefaceID);
+ SkAutoTUnref<SkTypeface> aur;
+ if (NULL == origTypeface) {
+ origTypeface = aur.reset(SkTypeface::RefDefault());
+ }
+
+ int ttcIndex;
+ SkStream* fontData = origTypeface->openStream(&ttcIndex);
SkTypeface* streamTypeface = SkTypeface::CreateFromStream(fontData);
SkSafeUnref(paint.setTypeface(streamTypeface));
drawBG(&streamCanvas);