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

Unified Diff: gm/downsamplebitmap.cpp

Issue 1818043002: SkTypeface::MakeFromName to take SkFontStyle. (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Android fix + nit fix Created 4 years, 7 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 | « gm/dftext.cpp ('k') | gm/filterbitmap.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/downsamplebitmap.cpp
diff --git a/gm/downsamplebitmap.cpp b/gm/downsamplebitmap.cpp
index 598382484f17ddab0f241adbd10b51d59e144401..ce3eb6965453906d8f035e3dfcc89e0054d2db84 100644
--- a/gm/downsamplebitmap.cpp
+++ b/gm/downsamplebitmap.cpp
@@ -29,7 +29,7 @@ static void make_checker(SkBitmap* bm, int size, int numChecks) {
}
}
-static void setTypeface(SkPaint* paint, const char name[], SkTypeface::Style style) {
+static void setTypeface(SkPaint* paint, const char name[], SkFontStyle style) {
sk_tool_utils::set_portable_typeface(paint, name, style);
}
@@ -125,13 +125,13 @@ class DownsampleBitmapTextGM: public DownsampleBitmapGM {
paint.setSubpixelText(true);
paint.setTextSize(fTextSize);
- setTypeface(&paint, "serif", SkTypeface::kNormal);
+ setTypeface(&paint, "serif", SkFontStyle());
canvas.drawText("Hamburgefons", 12, fTextSize/2, 1.2f*fTextSize, paint);
- setTypeface(&paint, "serif", SkTypeface::kBold);
+ setTypeface(&paint, "serif", SkFontStyle::FromOldStyle(SkTypeface::kBold));
canvas.drawText("Hamburgefons", 12, fTextSize/2, 2.4f*fTextSize, paint);
- setTypeface(&paint, "serif", SkTypeface::kItalic);
+ setTypeface(&paint, "serif", SkFontStyle::FromOldStyle(SkTypeface::kItalic));
canvas.drawText("Hamburgefons", 12, fTextSize/2, 3.6f*fTextSize, paint);
- setTypeface(&paint, "serif", SkTypeface::kBoldItalic);
+ setTypeface(&paint, "serif", SkFontStyle::FromOldStyle(SkTypeface::kBoldItalic));
canvas.drawText("Hamburgefons", 12, fTextSize/2, 4.8f*fTextSize, paint);
}
private:
« no previous file with comments | « gm/dftext.cpp ('k') | gm/filterbitmap.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698