Chromium Code Reviews| Index: Source/core/platform/graphics/skia/SkiaUtils.cpp |
| diff --git a/Source/core/platform/graphics/skia/SkiaUtils.cpp b/Source/core/platform/graphics/skia/SkiaUtils.cpp |
| index 7c2bfdd806715bd001c8f385f575c76bd166b046..77ed53cf118a190e49be748d8754390ad18600d3 100644 |
| --- a/Source/core/platform/graphics/skia/SkiaUtils.cpp |
| +++ b/Source/core/platform/graphics/skia/SkiaUtils.cpp |
| @@ -139,9 +139,9 @@ void ClipRectToCanvas(const GraphicsContext* context, const SkRect& srcRect, SkR |
| destRect->setEmpty(); |
| } |
| -bool SkPathContainsPoint(SkPath* originalPath, const FloatPoint& point, SkPath::FillType ft) |
| +bool SkPathContainsPoint(const SkPath& originalPath, const FloatPoint& point, SkPath::FillType ft) |
| { |
| - SkRect bounds = originalPath->getBounds(); |
| + SkRect bounds = originalPath.getBounds(); |
| // We can immediately return false if the point is outside the bounding |
| // rect. We don't use bounds.contains() here, since it would exclude |
| @@ -167,21 +167,17 @@ bool SkPathContainsPoint(SkPath* originalPath, const FloatPoint& point, SkPath:: |
| SkRegion rgn; |
| SkRegion clip; |
| SkMatrix m; |
| - SkPath scaledPath; |
| - |
| - SkPath::FillType originalFillType = originalPath->getFillType(); |
| - originalPath->setFillType(ft); |
| + SkPath scaledPath(originalPath); |
| + scaledPath.setFillType(ft); |
| m.setScale(scale, scale); |
| - originalPath->transform(m, &scaledPath); |
| + scaledPath.transform(m, 0); |
|
pdr.
2013/07/23 00:27:21
Oh my, we create a transform just to scale the pat
|
| int x = static_cast<int>(floorf(0.5f + point.x() * scale)); |
| int y = static_cast<int>(floorf(0.5f + point.y() * scale)); |
| clip.setRect(x - 1, y - 1, x + 1, y + 1); |
| - bool contains = rgn.setPath(scaledPath, clip); |
| - originalPath->setFillType(originalFillType); |
| - return contains; |
| + return rgn.setPath(scaledPath, clip); |
| } |
| } // namespace WebCore |