DEF_SIMPLE_GM(colorwheelnative, canvas, 128, 28) {
SkPaint paint;
- sk_tool_utils::set_portable_typeface(&paint, NULL, SkTypeface::kBold);
+ sk_tool_utils::set_portable_typeface_always(&paint, NULL, SkTypeface::kBold);
paint.setTextSize(18.0f);
- canvas->clear(SK_ColorLTGRAY);
+ canvas->clear(sk_tool_utils::color_to_565(SK_ColorLTGRAY));
paint.setColor(SK_ColorRED);
canvas->drawText("R", 1, 8.0f, 20.0f, paint);
paint.setColor(SK_ColorGREEN);
canvas.clear(0x00000000);
SkPaint paint;
paint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface(&paint);
- paint.setColor(0xFF884422);
+ sk_tool_utils::set_portable_typeface_always(&paint);
+ paint.setColor(sk_tool_utils::color_to_565(0xFF884422));
paint.setTextSize(SkIntToScalar(96));
const char* str = "g";
canvas.drawText(str, strlen(str), SkIntToScalar(15), SkIntToScalar(55), paint);
void make_checkerboard(SkBitmap* bitmap, int w, int h) {
bitmap->allocN32Pixels(w, h);
SkCanvas canvas(*bitmap);
- sk_tool_utils::draw_checkerboard(&canvas, 0xFF244484, 0xFF804020, 8);
+ sk_tool_utils::draw_checkerboard(&canvas, sk_tool_utils::color_to_565(0xFF244484),
+ sk_tool_utils::color_to_565(0xFF804020), 8);
}
virtual SkISize onISize() {
paint.setImageFilter(imf);
paint.setColor(SK_ColorGREEN);
paint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface(&paint);
+ sk_tool_utils::set_portable_typeface_always(&paint);
paint.setTextSize(r.height()/2);
paint.setTextAlign(SkPaint::kCenter_Align);
canvas->save();
SkPaint paint;
paint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface(&paint);
+ sk_tool_utils::set_portable_typeface_always(&paint);
paint.setTextSize(SkIntToScalar(48));
canvas->translate(SkIntToScalar(10), SkIntToScalar(64));