summaryrefslogtreecommitdiffstats
path: root/WebCore/platform/graphics/android
diff options
context:
space:
mode:
authorMike Reed <>2009-04-02 09:06:19 -0700
committerThe Android Open Source Project <initial-contribution@android.com>2009-04-02 09:06:19 -0700
commit080bc1ba7b8ddbf64777662f6427ae3f578c1c04 (patch)
tree882d3428290a248f16f4d78fa9340c77ff663477 /WebCore/platform/graphics/android
parent14d0be6801cd4bc19dc6108784d1eedcfd2279e7 (diff)
downloadexternal_webkit-080bc1ba7b8ddbf64777662f6427ae3f578c1c04.zip
external_webkit-080bc1ba7b8ddbf64777662f6427ae3f578c1c04.tar.gz
external_webkit-080bc1ba7b8ddbf64777662f6427ae3f578c1c04.tar.bz2
AI 144018: change path to return its internal cached bounds, making it much lighter-weight to get the bounds.
BUG=1748928 Automated import of CL 144018
Diffstat (limited to 'WebCore/platform/graphics/android')
-rw-r--r--WebCore/platform/graphics/android/PathAndroid.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/WebCore/platform/graphics/android/PathAndroid.cpp b/WebCore/platform/graphics/android/PathAndroid.cpp
index cfcd2bc..af870f5 100644
--- a/WebCore/platform/graphics/android/PathAndroid.cpp
+++ b/WebCore/platform/graphics/android/PathAndroid.cpp
@@ -89,9 +89,7 @@ void Path::translate(const FloatSize& size)
FloatRect Path::boundingRect() const
{
- SkRect r;
-
- m_path->computeBounds(&r, SkPath::kExact_BoundsType);
+ const SkRect& r = m_path->getBounds();
return FloatRect( SkScalarToFloat(r.fLeft),
SkScalarToFloat(r.fTop),
SkScalarToFloat(r.width()),
@@ -283,9 +281,9 @@ static FloatRect boundingBoxForCurrentStroke(GraphicsContext* context)
context->setupStrokePaint(&paint);
SkPath fillPath;
paint.getFillPath(*path, &fillPath);
- SkRect r;
- fillPath.computeBounds(&r, SkPath::kExact_BoundsType);
- return FloatRect(r.fLeft, r.fTop, r.width(), r.height());
+ const SkRect& r = fillPath.getBounds();
+ return FloatRect(SkScalarToFloat(r.fLeft), SkScalarToFloat(r.fTop),
+ SkScalarToFloat(r.width()), SkScalarToFloat(r.height()));
}
static GraphicsContext* scratchContext()