Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(34)

Unified Diff: trunk/tests/FontHostStreamTest.cpp

Issue 12739006: move most of SkFontHost to private (preceeding making it all private) (Closed) Base URL: http://skia.googlecode.com/svn/
Patch Set: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « trunk/src/ports/SkFontHost_mac.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/tests/FontHostStreamTest.cpp
===================================================================
--- trunk/tests/FontHostStreamTest.cpp (revision 8138)
+++ trunk/tests/FontHostStreamTest.cpp (working copy)
@@ -91,8 +91,13 @@
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());
bungeman-skia 2013/03/14 03:47:34 I see that you checked in https://code.google.com/
reed1 2013/03/14 14:22:42 I'm not sure which pattern I like better yet, so I
+ }
+
+ int ttcIndex;
+ SkStream* fontData = origTypeface->openStream(&ttcIndex);
SkTypeface* streamTypeface = SkTypeface::CreateFromStream(fontData);
SkSafeUnref(paint.setTypeface(streamTypeface));
drawBG(&streamCanvas);
« no previous file with comments | « trunk/src/ports/SkFontHost_mac.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698