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

Unified Diff: gm/filterbitmap.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/downsamplebitmap.cpp ('k') | gm/fontcache.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/filterbitmap.cpp
diff --git a/gm/filterbitmap.cpp b/gm/filterbitmap.cpp
index 51a8064d801a91057ccaee75008e17e1c35b1a32..ec20e6efbe679a2aa5f5a33c92b0fa4f49adadb7 100644
--- a/gm/filterbitmap.cpp
+++ b/gm/filterbitmap.cpp
@@ -12,7 +12,7 @@
#include "SkStream.h"
#include "SkTypeface.h"
-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);
}
@@ -123,13 +123,13 @@ class FilterBitmapTextGM: public FilterBitmapGM {
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/downsamplebitmap.cpp ('k') | gm/fontcache.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698