Bug 40362 - [Qt] canvas/philip/tests/2d.path.stroke.overlap.html fails with Qt-4.6.2 or higher
Summary: [Qt] canvas/philip/tests/2d.path.stroke.overlap.html fails with Qt-4.6.2 or h...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC All
: P2 Normal
Assignee: Rafael Brandao
URL:
Keywords: Qt, QtTriaged
Depends on:
Blocks: 79666
  Show dependency treegraph
 
Reported: 2010-06-09 07:12 PDT by Csaba Osztrogonác
Modified: 2012-05-22 12:22 PDT (History)
6 users (show)

See Also:


Attachments
Patch (6.06 KB, patch)
2012-05-21 17:34 PDT, Rafael Brandao
no flags Details | Formatted Diff | Diff
Patch (6.37 KB, patch)
2012-05-22 09:56 PDT, Rafael Brandao
no flags Details | Formatted Diff | Diff
Patch (6.33 KB, patch)
2012-05-22 10:41 PDT, Rafael Brandao
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Csaba Osztrogonác 2010-06-09 07:12:06 PDT
canvas/philip/tests/2d.path.stroke.overlap.html passes 
with Qt-4.6.0, but fails with Qt-4.6.2 and Qt-4.7.0.

--- /home/webkitbuildbot/slaves/release32bit-4.7.0/buildslave/qt-linux-32-release-qt470/build/layout-test-results/canvas/philip/tests/2d.path.stroke.overlap-expected.txt	2010-06-09 03:27:09.907399661 -0700
+++ /home/webkitbuildbot/slaves/release32bit-4.7.0/buildslave/qt-linux-32-release-qt470/build/layout-test-results/canvas/philip/tests/2d.path.stroke.overlap-actual.txt	2010-06-09 03:27:09.903399630 -0700
@@ -5,4 +5,4 @@
 Actual output:
 Expected output:
 
-Passed
+Failed assertion: got pixel [0,191,0,255] at (50,25), expected [0,127,0,255] +/- 1
Comment 1 Csaba Osztrogonác 2010-06-09 07:34:34 PDT
Skipped by http://trac.webkit.org/changeset/60890 until fix
to make buildbots happy after update to Qt-4.6.2.
Comment 2 WebKit Review Bot 2010-06-09 08:36:01 PDT
http://trac.webkit.org/changeset/60890 might have broken GTK Linux 32-bit Debug
The following changes are on the blame list:
http://trac.webkit.org/changeset/60890
http://trac.webkit.org/changeset/60891
http://trac.webkit.org/changeset/60892
Comment 3 Csaba Osztrogonác 2010-06-09 08:54:22 PDT
(In reply to comment #2)
> http://trac.webkit.org/changeset/60890 might have broken GTK Linux 32-bit Debug
> The following changes are on the blame list:
> http://trac.webkit.org/changeset/60890
> http://trac.webkit.org/changeset/60891
> http://trac.webkit.org/changeset/60892

no, we are innocent now. :)
Comment 4 Csaba Osztrogonác 2012-05-18 05:49:19 PDT
Still valid bug with Qt 4.8 and Qt 5 WK1 and WK2.
Comment 5 Rafael Brandao 2012-05-18 09:44:58 PDT
I'll investigate it.
Comment 6 Rafael Brandao 2012-05-21 12:02:58 PDT
(In reply to comment #5)
> I'll investigate it.

According to spec: "As a result of how the algorithm to trace a path is defined, overlapping parts of the paths in one stroke operation are treated as if _their union_ was what was painted."

We are not handling like that, but we are painting the intersection darker, thus the failure on it. It came out that the problem is how the function QPainter::strokePath works, I'm still trying to figure out a great solution for it.
Comment 7 Rafael Brandao 2012-05-21 17:34:04 PDT
Created attachment 143148 [details]
Patch

Hey No'am, could you take a look?
Comment 8 Noam Rosenthal 2012-05-22 09:07:57 PDT
Comment on attachment 143148 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=143148&action=review

> Source/WebCore/platform/graphics/qt/GraphicsContextQt.cpp:575
> +            QPainterPath stroke = pathStroker.createStroke(platformPath);
> +            p->fillPath(stroke, shadowPen.brush());

You repeat this sequence about 5 times, please put it in some static function.
Comment 9 Rafael Brandao 2012-05-22 09:56:36 PDT
Created attachment 143318 [details]
Patch
Comment 10 Noam Rosenthal 2012-05-22 10:03:08 PDT
Comment on attachment 143318 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=143318&action=review

> Source/WebCore/platform/graphics/qt/GraphicsContextQt.cpp:531
> +inline static void fillPathStroke(QPainter* painter, QPainterPathStroker& pathStroker, QPainterPath& platformPath, const QBrush& brush)

shouldn't platformPath be a const reference?
Comment 11 Rafael Brandao 2012-05-22 10:41:41 PDT
Created attachment 143326 [details]
Patch
Comment 12 WebKit Review Bot 2012-05-22 12:22:35 PDT
Comment on attachment 143326 [details]
Patch

Clearing flags on attachment: 143326

Committed r118020: <http://trac.webkit.org/changeset/118020>
Comment 13 WebKit Review Bot 2012-05-22 12:22:41 PDT
All reviewed patches have been landed.  Closing bug.