| Index: third_party/WebKit/Source/platform/graphics/Path.cpp
|
| diff --git a/third_party/WebKit/Source/platform/graphics/Path.cpp b/third_party/WebKit/Source/platform/graphics/Path.cpp
|
| index 2fd75f846eb85a9d762f0115ee9bc2a8ea9b0e00..65f73ce7c905be3c5793f5f090daa7267c583f72 100644
|
| --- a/third_party/WebKit/Source/platform/graphics/Path.cpp
|
| +++ b/third_party/WebKit/Source/platform/graphics/Path.cpp
|
| @@ -115,14 +115,31 @@ bool Path::strokeContains(const FloatPoint& point, const StrokeData& strokeData)
|
| return strokePath(strokeData).contains(WebCoreFloatToSkScalar(point.x()), WebCoreFloatToSkScalar(point.y()));
|
| }
|
|
|
| -FloatRect Path::boundingRect() const
|
| +namespace {
|
| +
|
| +FloatRect pathBounds(const SkPath& path, Path::BoundsType boundsType)
|
| +{
|
| + SkRect bounds;
|
| + if (boundsType == Path::BoundsType::Conservative
|
| + || !TightBounds(path, &bounds)
|
| + || bounds.isEmpty()) // workaround for https://bugs.chromium.org/p/skia/issues/detail?id=5555
|
| + return path.getBounds();
|
| +
|
| + DCHECK_EQ(boundsType, Path::BoundsType::Exact);
|
| + return bounds;
|
| +}
|
| +
|
| +} // anonymous ns
|
| +
|
| +// TODO(fmalita): evaluate returning exact bounds in all cases.
|
| +FloatRect Path::boundingRect(BoundsType boundsType) const
|
| {
|
| - return m_path.getBounds();
|
| + return pathBounds(m_path, boundsType);
|
| }
|
|
|
| -FloatRect Path::strokeBoundingRect(const StrokeData& strokeData) const
|
| +FloatRect Path::strokeBoundingRect(const StrokeData& strokeData, BoundsType boundsType) const
|
| {
|
| - return strokePath(strokeData).getBounds();
|
| + return pathBounds(strokePath(strokeData), boundsType);
|
| }
|
|
|
| static FloatPoint* convertPathPoints(FloatPoint dst[], const SkPoint src[], int count)
|
|
|