SkPaint titlePaint;
titlePaint.setColor(SK_ColorBLACK);
titlePaint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface(&titlePaint);
+ sk_tool_utils::set_portable_typeface_always(&titlePaint);
titlePaint.setLCDRenderText(true);
titlePaint.setTextSize(15 * SK_Scalar1);
const char title[] = "Empty Paths Drawn Into Rectangle Clips With "
SkColor color = rand.nextU();
- color = 0xff000000| color; // force solid
+ color = 0xff000000 | color; // force solid
+ sk_tool_utils::color_to_565(&color);
this->drawEmpty(canvas, color, rect,
gStyles[style].fStyle, gFills[fill].fFill);
SkPaint labelPaint;
labelPaint.setColor(color);
labelPaint.setAntiAlias(true);
- sk_tool_utils::set_portable_typeface(&labelPaint);
- labelPaint.setLCDRenderText(true);
+ sk_tool_utils::set_portable_typeface_always(&labelPaint);
labelPaint.setTextSize(12 * SK_Scalar1);
canvas->drawText(gStyles[style].fName,
strlen(gStyles[style].fName),
}
}
+void color_to_565(SkColor* color) {
+ SkPMColor pmColor = SkPreMultiplyColor(*color);
+ U16CPU color16 = SkPixel32ToPixel16(pmColor);
+ *color = SkPixel16ToColor(color16);
+}
+
SkTypeface* create_portable_typeface(const char* name, SkTypeface::Style style) {
SkTypeface* face;
if (FLAGS_portableFonts) {
namespace sk_tool_utils {
const char* colortype_name(SkColorType);
+ void color_to_565(SkColor* color);
/**
* Sets the paint to use a platform-independent text renderer if FLAGS_portableFonts is set.