diff options
author | epoger@google.com <epoger@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-05-19 17:36:21 +0000 |
---|---|---|
committer | epoger@google.com <epoger@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-05-19 17:36:21 +0000 |
commit | 65245ade841a7aa4d71b1760c081959c71cb4560 (patch) | |
tree | b83979650a646ef686f0ae539f0dcc310091226d | |
parent | ef3913bcbff265ff86116ae4f3dd2768dc42ccca (diff) |
fix assertion failure in Skia_Linux_Fixed_Debug build
http://codereview.appspot.com/4556043/
git-svn-id: http://skia.googlecode.com/svn/trunk@1381 2bbb7eff-a529-9590-31e7-b0007b416f81
-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); } - - |