Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1602)

Unified Diff: Source/core/platform/graphics/Path.cpp

Issue 19846006: Use const path in SkPathContainsPoint (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/platform/graphics/Path.cpp
diff --git a/Source/core/platform/graphics/Path.cpp b/Source/core/platform/graphics/Path.cpp
index fd913d6d75687eee3f855b7507b33d44b0ea7906..015788d3bc2e077344d3e9bd84f1f27e8025e271 100644
--- a/Source/core/platform/graphics/Path.cpp
+++ b/Source/core/platform/graphics/Path.cpp
@@ -69,9 +69,7 @@ bool Path::operator==(const Path& other) const
bool Path::contains(const FloatPoint& point, WindRule rule) const
{
- // After crbug.com/236559 is fixed, SkPathContainsPoint should take a const path so this will be unnecessary.
- SkPath* path = const_cast<SkPath*>(&m_path);
- return SkPathContainsPoint(path, point, rule == RULE_NONZERO ? SkPath::kWinding_FillType : SkPath::kEvenOdd_FillType);
+ return SkPathContainsPoint(m_path, point, rule == RULE_NONZERO ? SkPath::kWinding_FillType : SkPath::kEvenOdd_FillType);
}
bool Path::strokeContains(const FloatPoint& point, const StrokeData& strokeData) const
@@ -81,7 +79,7 @@ bool Path::strokeContains(const FloatPoint& point, const StrokeData& strokeData)
SkPath strokePath;
paint.getFillPath(m_path, &strokePath);
- return SkPathContainsPoint(&strokePath, point, SkPath::kWinding_FillType);
+ return SkPathContainsPoint(strokePath, point, SkPath::kWinding_FillType);
}
FloatRect Path::boundingRect() const
« no previous file with comments | « no previous file | Source/core/platform/graphics/skia/SkiaUtils.h » ('j') | Source/core/platform/graphics/skia/SkiaUtils.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698