Index: gm/pixelsnap.cpp |
diff --git a/gm/pixelsnap.cpp b/gm/pixelsnap.cpp |
index 8a513f3ca5409725def3c39ea2bb0c08a6d62c3a..3358e9d410caffb2683c3bc4c89c62d30c6134a5 100644 |
--- a/gm/pixelsnap.cpp |
+++ b/gm/pixelsnap.cpp |
@@ -35,7 +35,9 @@ protected: |
void onDraw(SkCanvas* canvas) override { |
SkPaint bgPaint; |
bgPaint.setShader( |
- sk_tool_utils::create_checkerboard_shader(0xFFAAAAAA, 0xFF777777, 1))->unref(); |
+ sk_tool_utils::create_checkerboard_shader( |
+ sk_tool_utils::color_to_565(0xFFAAAAAA), |
+ sk_tool_utils::color_to_565(0xFF777777), 1))->unref(); |
canvas->drawPaint(bgPaint); |
SkString offset; |
@@ -43,33 +45,31 @@ protected: |
labelPaint.setAntiAlias(true); |
labelPaint.setColor(SK_ColorWHITE); |
labelPaint.setTextSize(SkIntToScalar(kLabelTextSize)); |
+ sk_tool_utils::set_portable_typeface(&labelPaint); |
SkPaint linePaint; |
linePaint.setColor(SK_ColorWHITE); |
- // Drawing labels is useful for debugging, but bad for baselining (x-platform txt diffs). |
- if (false) { |
- // Draw row labels |
- canvas->save(); |
- canvas->translate(0, SkIntToScalar(kLabelOffsetY)); |
- for (int i = 0; i <= kSubPixelSteps; ++i) { |
- offset.printf("%d", i); |
- canvas->drawText(offset.c_str(), offset.size(), |
- 0, i * kTrans + labelPaint.getTextSize(), |
- labelPaint); |
- } |
- canvas->restore(); |
- |
- // Draw col labels |
- canvas->save(); |
- canvas->translate(SkIntToScalar(kLabelOffsetX), 0); |
- for (int i = 0; i <= kSubPixelSteps; ++i) { |
- offset.printf("%d", i); |
- canvas->drawText(offset.c_str(), offset.size(), |
- i * SkIntToScalar(kTrans), labelPaint.getTextSize(), |
- labelPaint); |
- } |
- canvas->restore(); |
- } |
+ // Draw row labels |
+ canvas->save(); |
+ canvas->translate(0, SkIntToScalar(kLabelOffsetY)); |
+ for (int i = 0; i <= kSubPixelSteps; ++i) { |
+ offset.printf("%d", i); |
+ canvas->drawText(offset.c_str(), offset.size(), |
+ 0, i * kTrans + labelPaint.getTextSize(), |
+ labelPaint); |
+ } |
+ canvas->restore(); |
+ |
+ // Draw col labels |
+ canvas->save(); |
+ canvas->translate(SkIntToScalar(kLabelOffsetX), 0); |
+ for (int i = 0; i <= kSubPixelSteps; ++i) { |
+ offset.printf("%d", i); |
+ canvas->drawText(offset.c_str(), offset.size(), |
+ i * SkIntToScalar(kTrans), labelPaint.getTextSize(), |
+ labelPaint); |
+ } |
+ canvas->restore(); |
canvas->translate(SkIntToScalar(kLabelOffsetX), SkIntToScalar(kLabelOffsetY)); |