Skip to content

Commit

Permalink
update site to use SkFont for text fields (flutter#7464)
Browse files Browse the repository at this point in the history
  • Loading branch information
reed-at-google authored and brianosman committed Jan 14, 2019
1 parent e68a3fa commit fea645b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions flow/layers/performance_overlay_layer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <string>

#include "flutter/flow/layers/performance_overlay_layer.h"
#include "third_party/skia/include/core/SkFont.h"

namespace flow {
namespace {
Expand All @@ -15,12 +16,13 @@ void DrawStatisticsText(SkCanvas& canvas,
const std::string& string,
int x,
int y) {
SkFont font;
font.setSize(15);
font.setLinearMetrics(false);
SkPaint paint;
paint.setTextSize(15);
paint.setLinearText(false);
paint.setColor(SK_ColorGRAY);
paint.setAntiAlias(true);
canvas.drawText(string.c_str(), string.size(), x, y, paint);
canvas.drawSimpleText(string.c_str(), string.size(), kUTF8_SkTextEncoding, x,
y, font, paint);
}

void VisualizeStopWatch(SkCanvas& canvas,
Expand Down

0 comments on commit fea645b

Please sign in to comment.