aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm
diff options
context:
space:
mode:
authorGravatar epoger@google.com <epoger@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-05-19 17:36:21 +0000
committerGravatar epoger@google.com <epoger@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-05-19 17:36:21 +0000
commit65245ade841a7aa4d71b1760c081959c71cb4560 (patch)
treeb83979650a646ef686f0ae539f0dcc310091226d /gm
parentef3913bcbff265ff86116ae4f3dd2768dc42ccca (diff)
fix assertion failure in Skia_Linux_Fixed_Debug build
Diffstat (limited to 'gm')
-rw-r--r--gm/shadertext.cpp7
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);
}
-
-