Index: src/effects/SkDisplacementMapEffect.cpp |
diff --git a/src/effects/SkDisplacementMapEffect.cpp b/src/effects/SkDisplacementMapEffect.cpp |
index 15ac62737214aeb4c48717526a6ca9ddd1adaa80..816807d04ea2f0224a7c3bfda75ac4ce20629ca2 100644 |
--- a/src/effects/SkDisplacementMapEffect.cpp |
+++ b/src/effects/SkDisplacementMapEffect.cpp |
@@ -49,7 +49,7 @@ template<SkDisplacementMapEffect::ChannelSelectorType typeX, |
SkDisplacementMapEffect::ChannelSelectorType typeY> |
void computeDisplacement(SkScalar scale, SkBitmap* dst, SkBitmap* displ, SkBitmap* src, const SkIRect& bounds) |
{ |
- static const SkScalar Inv8bit = SkScalarDiv(SK_Scalar1, SkFloatToScalar(255.0f)); |
+ static const SkScalar Inv8bit = SkScalarDiv(SK_Scalar1, 255.0f); |
const int srcW = src->width(); |
const int srcH = src->height(); |
const SkScalar scaleForColor = SkScalarMul(scale, Inv8bit); |
@@ -413,7 +413,7 @@ GrEffectRef* GrDisplacementMapEffect::TestCreate(SkRandom* random, |
SkDisplacementMapEffect::ChannelSelectorType yChannelSelector = |
static_cast<SkDisplacementMapEffect::ChannelSelectorType>( |
random->nextRangeU(1, kMaxComponent)); |
- SkScalar scale = random->nextRangeScalar(0, SkFloatToScalar(100.0f)); |
+ SkScalar scale = random->nextRangeScalar(0, 100.0f); |
return GrDisplacementMapEffect::Create(xChannelSelector, yChannelSelector, scale, |
textures[texIdxDispl], textures[texIdxColor]); |