[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
commit-queue at webkit.org
commit-queue at webkit.org
Wed Dec 22 14:42:06 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 300ddae4e48d957846677523265965e1089c811b
Author: commit-queue at webkit.org <commit-queue at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Sun Oct 17 14:31:14 2010 +0000
2010-10-17 Sergey A. Sukiyazov <sergey.sukiyazov at gmail.com>
Reviewed by Andreas Kling
[Qt] Hovering the mouse over links produce a trail of underlined links (X11 paint engine)
https://bugs.webkit.org/show_bug.cgi?id=42248
The problem will appear because coordinates of points may increase by 0.05f (if line width is odd) inside
method GraphicsContext::adjustLineToPixelBoundaries(...) and become outside of text bounding rect htere,
then the new point coordinates will be passed to Qt graphics engine.
The solution decreases Y cordinates of points inside drawLineForText(...) method only if Qt graphics engine
is X11. The Y coordinates will be increase by 0.5f inside method adjustLineToPixelBoundaries(...), which
called from drawLine(...), and then inside Qt painting engine will be rounded to next greater integer value.
NOTE: This changes will affect only Qt X11 verision and if only X11 Painting Engine will be used.
No new tests.
* platform/graphics/qt/GraphicsContextQt.cpp:
(WebCore::GraphicsContext::drawLineForText):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@69923 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index cd1384b..ecbfb69 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,25 @@
+2010-10-17 Sergey A. Sukiyazov <sergey.sukiyazov at gmail.com>
+
+ Reviewed by Andreas Kling
+
+ [Qt] Hovering the mouse over links produce a trail of underlined links (X11 paint engine)
+ https://bugs.webkit.org/show_bug.cgi?id=42248
+
+ The problem will appear because coordinates of points may increase by 0.05f (if line width is odd) inside
+ method GraphicsContext::adjustLineToPixelBoundaries(...) and become outside of text bounding rect htere,
+ then the new point coordinates will be passed to Qt graphics engine.
+
+ The solution decreases Y cordinates of points inside drawLineForText(...) method only if Qt graphics engine
+ is X11. The Y coordinates will be increase by 0.5f inside method adjustLineToPixelBoundaries(...), which
+ called from drawLine(...), and then inside Qt painting engine will be rounded to next greater integer value.
+
+ NOTE: This changes will affect only Qt X11 verision and if only X11 Painting Engine will be used.
+
+ No new tests.
+
+ * platform/graphics/qt/GraphicsContextQt.cpp:
+ (WebCore::GraphicsContext::drawLineForText):
+
2010-10-17 Rob Buis <rwlbuis at gmail.com>
Reviewed by Dirk Schulze.
diff --git a/WebCore/platform/graphics/qt/GraphicsContextQt.cpp b/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
index 897aecd..a385e4a 100644
--- a/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
+++ b/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
@@ -843,8 +843,28 @@ void GraphicsContext::drawLineForText(const IntPoint& origin, int width, bool)
if (paintingDisabled())
return;
+ IntPoint startPoint = origin;
IntPoint endPoint = origin + IntSize(width, 0);
- drawLine(origin, endPoint);
+
+ // If paintengine type is X11 to avoid artifacts
+ // like bug https://bugs.webkit.org/show_bug.cgi?id=42248
+#if defined(Q_WS_X11)
+ QPainter* p = m_data->p();
+ if (p->paintEngine()->type() == QPaintEngine::X11) {
+ // If stroke thickness is odd we need decrease Y coordinate by 1 pixel,
+ // because inside method adjustLineToPixelBoundaries(...), which
+ // called from drawLine(...), Y coordinate will be increased by 0.5f
+ // and then inside Qt painting engine will be rounded to next greater
+ // integer value.
+ float strokeWidth = strokeThickness();
+ if (static_cast<int>(strokeWidth) % 2) {
+ startPoint.setY(startPoint.y() - 1);
+ endPoint.setY(endPoint.y() - 1);
+ }
+ }
+#endif // defined(Q_WS_X11)
+
+ drawLine(startPoint, endPoint);
}
void GraphicsContext::drawLineForTextChecking(const IntPoint&, int, TextCheckingLineStyle)
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list