diff options
-rw-r--r-- | gm/shadertext.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/gm/shadertext.cpp b/gm/shadertext.cpp index 1cf562cc86..045c399e8f 100644 --- a/gm/shadertext.cpp +++ b/gm/shadertext.cpp @@ -11,7 +11,8 @@ static void makebm(SkBitmap* bm, SkBitmap::Config config, int w, int h) { bm->eraseColor(0); SkCanvas canvas(*bm); - SkScalar s = w < h ? w : h; + int shorterDimensionAsInt = w < h ? w : h; + SkScalar s = SkIntToScalar(shorterDimensionAsInt); SkPoint pts[] = { { 0, 0 }, { s, s } }; SkColor colors[] = { SK_ColorRED, SK_ColorGREEN, SK_ColorBLUE }; SkScalar pos[] = { 0, SK_Scalar1/2, SK_Scalar1 }; @@ -121,7 +122,7 @@ protected: const char text[] = "Shaded Text"; const int textLen = SK_ARRAY_COUNT(text) - 1; - static int pointSize = SkIntToScalar(48); + const int pointSize = 48; int w = pointSize * textLen; int h = pointSize; @@ -194,5 +195,3 @@ static GM* MyFactory(void*) { return new ShaderTextGM; } static GMRegistry reg(MyFactory); } - - |