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

Unified Diff: tools/sk_tool_utils.cpp

Issue 348323003: use platform-independent font for gm (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add include tools for skimage Created 6 years, 6 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 | « tools/sk_tool_utils.h ('k') | tools/sk_tool_utils_font.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/sk_tool_utils.cpp
diff --git a/tools/sk_tool_utils.cpp b/tools/sk_tool_utils.cpp
index c75c496a890c0d2526d74cc93d01bf6c305ae288..1b35005d963a19146d429a912b643f1073ade5e1 100644
--- a/tools/sk_tool_utils.cpp
+++ b/tools/sk_tool_utils.cpp
@@ -6,12 +6,15 @@
*/
#include "sk_tool_utils.h"
+#include "../src/fonts/SkTestScalerContext.h"
#include "SkBitmap.h"
#include "SkCanvas.h"
namespace sk_tool_utils {
+bool gEnablePortableTypeface = false;
+
const char* colortype_name(SkColorType ct) {
switch (ct) {
case kUnknown_SkColorType: return "Unknown";
@@ -27,6 +30,14 @@ const char* colortype_name(SkColorType ct) {
}
}
+SkPaint::FontMetrics create_font(SkTDArray<SkPath*>& , SkTDArray<SkFixed>& );
+
+void set_portable_typeface(SkPaint* paint, SkTypeface::Style style) {
+ if (gEnablePortableTypeface) {
+ SkSafeUnref(paint->setTypeface(CreateTestTypeface(create_font, style)));
+ }
+}
+
void write_pixels(SkCanvas* canvas, const SkBitmap& bitmap, int x, int y,
SkColorType colorType, SkAlphaType alphaType) {
SkBitmap tmp(bitmap);
« no previous file with comments | « tools/sk_tool_utils.h ('k') | tools/sk_tool_utils_font.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698