OSDN Git Service

Remove old scalar conversions
authorRussell Brenner <russellbrenner@google.com>
Sat, 2 Jul 2011 00:04:06 +0000 (17:04 -0700)
committerRussell Brenner <russellbrenner@google.com>
Sat, 2 Jul 2011 00:20:50 +0000 (17:20 -0700)
The webkit merge from CL 112610 introduced an api change in
setrectForUnderline, changing two params from int to float. The body
of the function, however, was still performing int to float
conversions, resulting in a debug assert within skia and conversion
results forced to zero. This CL removes the outdated conversion.

Change-Id: I0d5fae39552c3e6801b83e6c4363dc063a01b165

Source/WebCore/platform/graphics/android/GraphicsContextAndroid.cpp

index 429a125..e015f5a 100644 (file)
@@ -624,10 +624,10 @@ static void setrectForUnderline(SkRect* r, GraphicsContext* context, const Float
     if (lineThickness < 1) // Do we really need/want this?
         lineThickness = 1;
 #endif
-    r->fLeft    = SkIntToScalar(point.x());
-    r->fTop     = SkIntToScalar(point.y() + yOffset);
-    r->fRight   = r->fLeft + SkIntToScalar(width);
-    r->fBottom  = r->fTop + SkFloatToScalar(lineThickness);
+    r->fLeft    = point.x();
+    r->fTop     = point.y() + yOffset;
+    r->fRight   = r->fLeft + width;
+    r->fBottom  = r->fTop + lineThickness;
 }
 
 void GraphicsContext::drawLineForText(const FloatPoint& pt, float width, bool)