Title: [93774] trunk/Source/WebCore
- Revision
- 93774
- Author
- commit-qu...@webkit.org
- Date
- 2011-08-25 04:48:05 -0700 (Thu, 25 Aug 2011)
Log Message
[Qt] Path::boundingRect() is unnecessarily slow.
https://bugs.webkit.org/show_bug.cgi?id=66854
Patch by Andreas Kling <kl...@webkit.org> on 2011-08-25
Reviewed by Benjamin Poulain.
* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::CanvasRenderingContext2D::stroke): Remove Qt-specific optimization
since calling Path::boundingRect() will now do exactly the same thing.
* platform/graphics/qt/PathQt.cpp:
(WebCore::Path::boundingRect): Return QPainterPath::controlPointRect() since
that is much faster than computing the (precise) QPainterPath::boundingRect()
and Path::boundingRect() is not expected to be 100% precise anyway.
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (93773 => 93774)
--- trunk/Source/WebCore/ChangeLog 2011-08-25 11:31:46 UTC (rev 93773)
+++ trunk/Source/WebCore/ChangeLog 2011-08-25 11:48:05 UTC (rev 93774)
@@ -1,3 +1,18 @@
+2011-08-25 Andreas Kling <kl...@webkit.org>
+
+ [Qt] Path::boundingRect() is unnecessarily slow.
+ https://bugs.webkit.org/show_bug.cgi?id=66854
+
+ Reviewed by Benjamin Poulain.
+
+ * html/canvas/CanvasRenderingContext2D.cpp:
+ (WebCore::CanvasRenderingContext2D::stroke): Remove Qt-specific optimization
+ since calling Path::boundingRect() will now do exactly the same thing.
+ * platform/graphics/qt/PathQt.cpp:
+ (WebCore::Path::boundingRect): Return QPainterPath::controlPointRect() since
+ that is much faster than computing the (precise) QPainterPath::boundingRect()
+ and Path::boundingRect() is not expected to be 100% precise anyway.
+
2011-08-25 Yuta Kitamura <yu...@chromium.org>
WebSocket: Queue messages to be sent
Modified: trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp (93773 => 93774)
--- trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp 2011-08-25 11:31:46 UTC (rev 93773)
+++ trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp 2011-08-25 11:48:05 UTC (rev 93774)
@@ -924,11 +924,7 @@
return;
if (!m_path.isEmpty()) {
-#if PLATFORM(QT)
- FloatRect dirtyRect = m_path.platformPath().controlPointRect();
-#else
FloatRect dirtyRect = m_path.boundingRect();
-#endif
// Fast approximation of the stroke's bounding rect.
// This yields a slightly oversized rect but is very fast
// compared to Path::strokeBoundingRect().
Modified: trunk/Source/WebCore/platform/graphics/qt/PathQt.cpp (93773 => 93774)
--- trunk/Source/WebCore/platform/graphics/qt/PathQt.cpp 2011-08-25 11:31:46 UTC (rev 93773)
+++ trunk/Source/WebCore/platform/graphics/qt/PathQt.cpp 2011-08-25 11:48:05 UTC (rev 93774)
@@ -1,7 +1,8 @@
/*
- * Copyright (C) 2006 Zack Rusin <z...@kde.org>
- * 2006 Rob Buis <b...@kde.org>
- * 2009, 2010 Dirk Schulze <k...@webkit.org>
+ * Copyright (C) 2006 Zack Rusin <z...@kde.org>
+ * Copyright (C) 2006 Rob Buis <b...@kde.org>
+ * Copyright (C) 2009, 2010 Dirk Schulze <k...@webkit.org>
+ * Copyright (C) 2010, 2011 Andreas Kling <kl...@webkit.org>
*
* All rights reserved.
*
@@ -149,7 +150,7 @@
FloatRect Path::boundingRect() const
{
- return m_path.boundingRect();
+ return m_path.controlPointRect();
}
FloatRect Path::strokeBoundingRect(StrokeStyleApplier* applier) const
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes