| Index: gm/glyph_pos_align.cpp
|
| diff --git a/gm/glyph_pos_align.cpp b/gm/glyph_pos_align.cpp
|
| index 9add494ffd035a24455c3e8f1d1886b378ab951a..e80955e1acc91d121b1ed663a1e2bc904db71cec 100644
|
| --- a/gm/glyph_pos_align.cpp
|
| +++ b/gm/glyph_pos_align.cpp
|
| @@ -17,20 +17,9 @@ static const int kHeight = 600;
|
| static const SkScalar kTextHeight = 64.0f;
|
| static const int kMaxStringLength = 12;
|
|
|
| -namespace skiagm {
|
| -
|
| -class GlyphPosAlignGM : public GM {
|
| -protected:
|
| -
|
| - SkString onShortName() override {
|
| - return SkString("glyph_pos_align");
|
| - }
|
| -
|
| - SkISize onISize() override { return SkISize::Make(kWidth, kHeight); }
|
| -
|
| - void onDraw(SkCanvas* canvas) override {
|
| - canvas->clear(SK_ColorBLACK);
|
| +static void drawTestCase(SkCanvas*, const char*, SkScalar, const SkPaint&);
|
|
|
| +DEF_SIMPLE_GM_BG(glyph_pos_align, canvas, kWidth, kHeight, SK_ColorBLACK) {
|
| SkPaint paint;
|
| paint.setTextSize(kTextHeight);
|
| paint.setFakeBoldText(true);
|
| @@ -50,9 +39,9 @@ protected:
|
|
|
| paint.setTextAlign(SkPaint::kLeft_Align);
|
| drawTestCase(canvas, "Left Align", 7 * kTextHeight, paint);
|
| - }
|
| +}
|
|
|
| - void drawTestCase(SkCanvas* canvas, const char* text, SkScalar y, const SkPaint& paint) {
|
| +void drawTestCase(SkCanvas* canvas, const char* text, SkScalar y, const SkPaint& paint) {
|
| SkScalar widths[kMaxStringLength];
|
| SkScalar posX[kMaxStringLength];
|
| SkPoint pos[kMaxStringLength];
|
| @@ -78,19 +67,4 @@ protected:
|
|
|
| canvas->drawPosTextH(text, length, posX, y, paint);
|
| canvas->drawPosText(text, length, pos, paint);
|
| - }
|
| -
|
| -private:
|
| -
|
| - typedef GM INHERITED;
|
| -};
|
| -
|
| -//////////////////////////////////////////////////////////////////////////////
|
| -
|
| -static GM* GlyphPosAlignFactory(void*) {
|
| - return new GlyphPosAlignGM();
|
| -}
|
| -
|
| -static GMRegistry reg(GlyphPosAlignFactory);
|
| -
|
| }
|
|
|