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
This commit is contained in:
epoger@google.com 2011-05-19 17:36:21 +00:00
parent ef3913bcbf
commit 65245ade84

View File

@ -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);
}