aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--gm/glyph_pos.cpp7
-rw-r--r--gm/imageblur.cpp4
-rw-r--r--gm/imageblurtiled.cpp2
-rw-r--r--gm/largeglyphblur.cpp2
4 files changed, 5 insertions, 10 deletions
diff --git a/gm/glyph_pos.cpp b/gm/glyph_pos.cpp
index 16cdfca11a..90329ed7fd 100644
--- a/gm/glyph_pos.cpp
+++ b/gm/glyph_pos.cpp
@@ -48,9 +48,6 @@ protected:
SkISize onISize() override { return SkISize::Make(800, 600); }
void onDraw(SkCanvas* canvas) override {
- if (!fProp) {
- fProp.reset(sk_tool_utils::create_portable_typeface("Helvetica", SkTypeface::kNormal));
- }
// There's a black pixel at 40, 40 for reference.
canvas->drawPoint(40.0f, 40.0f, SK_ColorBLACK);
@@ -108,8 +105,7 @@ protected:
paint.setColor(SK_ColorBLACK);
paint.setAntiAlias(true);
paint.setTextSize(kTextHeight * textScale);
- paint.setTypeface(fProp);
- paint.setDevKernText(true);
+ sk_tool_utils::set_portable_typeface_always(&paint);
paint.setStrokeWidth(fStrokeWidth);
paint.setStyle(fStrokeStyle);
@@ -158,7 +154,6 @@ protected:
}
private:
- SkAutoTUnref<SkTypeface> fProp;
SkScalar fStrokeWidth;
SkPaint::Style fStrokeStyle;
diff --git a/gm/imageblur.cpp b/gm/imageblur.cpp
index c7139b4f65..d0f1fd1803 100644
--- a/gm/imageblur.cpp
+++ b/gm/imageblur.cpp
@@ -41,11 +41,11 @@ protected:
SkRandom rand;
SkPaint textPaint;
textPaint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface(&textPaint);
+ sk_tool_utils::set_portable_typeface_always(&textPaint);
for (int i = 0; i < 25; ++i) {
int x = rand.nextULessThan(WIDTH);
int y = rand.nextULessThan(HEIGHT);
- textPaint.setColor(rand.nextBits(24) | 0xFF000000);
+ textPaint.setColor(sk_tool_utils::color_to_565(rand.nextBits(24) | 0xFF000000));
textPaint.setTextSize(rand.nextRangeScalar(0, 300));
canvas->drawText(str, strlen(str), SkIntToScalar(x),
SkIntToScalar(y), textPaint);
diff --git a/gm/imageblurtiled.cpp b/gm/imageblurtiled.cpp
index ed4ae6cef3..5b00b1752a 100644
--- a/gm/imageblurtiled.cpp
+++ b/gm/imageblurtiled.cpp
@@ -50,7 +50,7 @@ protected:
};
SkPaint textPaint;
textPaint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface(&textPaint);
+ sk_tool_utils::set_portable_typeface_always(&textPaint);
textPaint.setTextSize(SkIntToScalar(100));
int posY = 0;
for (unsigned i = 0; i < SK_ARRAY_COUNT(str); i++) {
diff --git a/gm/largeglyphblur.cpp b/gm/largeglyphblur.cpp
index 8723824e13..9d9ff418cf 100644
--- a/gm/largeglyphblur.cpp
+++ b/gm/largeglyphblur.cpp
@@ -32,7 +32,7 @@ protected:
const char text[] = "Hamburgefons";
SkPaint paint;
- sk_tool_utils::set_portable_typeface(&paint);
+ sk_tool_utils::set_portable_typeface_always(&paint);
paint.setTextSize(256);
paint.setAntiAlias(true);