[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
andreas.kling at nokia.com
andreas.kling at nokia.com
Wed Dec 22 12:07:05 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit c3f2fe296b40e3e327c529d9e11b2d0f41efd8f9
Author: andreas.kling at nokia.com <andreas.kling at nokia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Sat Aug 14 22:44:20 2010 +0000
2010-08-14 Andreas Kling <andreas.kling at nokia.com>
Reviewed by Ariya Hidayat.
[Qt] Path: Fast approximation of stroke bounding rects
https://bugs.webkit.org/show_bug.cgi?id=44014
* platform/graphics/qt/PathQt.cpp:
(WebCore::Path::strokeBoundingRect): Use QPainterPath::controlPointRect()
to calculate a slightly larger bounding rect in a fraction of the time.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@65374 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index ee15799..97997e4 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,14 @@
+2010-08-14 Andreas Kling <andreas.kling at nokia.com>
+
+ Reviewed by Ariya Hidayat.
+
+ [Qt] Path: Fast approximation of stroke bounding rects
+ https://bugs.webkit.org/show_bug.cgi?id=44014
+
+ * platform/graphics/qt/PathQt.cpp:
+ (WebCore::Path::strokeBoundingRect): Use QPainterPath::controlPointRect()
+ to calculate a slightly larger bounding rect in a fraction of the time.
+
2010-08-14 Eric Seidel <eric at webkit.org>
Reviewed by Adam Barth.
diff --git a/WebCore/platform/graphics/qt/PathQt.cpp b/WebCore/platform/graphics/qt/PathQt.cpp
index de9de07..896d0c7 100644
--- a/WebCore/platform/graphics/qt/PathQt.cpp
+++ b/WebCore/platform/graphics/qt/PathQt.cpp
@@ -163,19 +163,17 @@ FloatRect Path::boundingRect() const
FloatRect Path::strokeBoundingRect(StrokeStyleApplier* applier)
{
GraphicsContext* gc = scratchContext();
- QPainterPathStroker stroke;
- if (applier) {
+
+ if (applier)
applier->strokeStyle(gc);
- QPen pen = gc->pen();
- stroke.setWidth(pen.widthF());
- stroke.setCapStyle(pen.capStyle());
- stroke.setJoinStyle(pen.joinStyle());
- stroke.setMiterLimit(pen.miterLimit());
- stroke.setDashPattern(pen.dashPattern());
- stroke.setDashOffset(pen.dashOffset());
- }
- return stroke.createStroke(m_path).boundingRect();
+ QPen pen = gc->pen();
+
+ // Fast approximation of the stroke's bounding rect.
+ // This yields a slightly oversized rect but is very fast compared to QPainterPathStroker.
+ FloatRect rect = m_path.controlPointRect();
+ rect.inflate(pen.miterLimit() + pen.widthF());
+ return rect;
}
void Path::moveTo(const FloatPoint& point)
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list