From 5131aa520779cbdeae33d22ff66195e7b03a0f9a Mon Sep 17 00:00:00 2001 From: "fred.wang@free.fr" Date: Tue, 8 Dec 2015 09:17:38 +0000 Subject: [PATCH] [cairo] Solid stroke of lines with thickness less than 1 pixel broken after r191658 https://bugs.webkit.org/show_bug.cgi?id=151947 Reviewed by Martin Robinson. Source/WebCore: Test: mathml/presentation/radical-bar-visibility.html * platform/graphics/cairo/GraphicsContextCairo.cpp: (WebCore::GraphicsContext::drawLine): Force a minimal thickness of 1px LayoutTests: Add a test to check that the radical overbar appears on the screen when it has thickness less than 1px. * mathml/presentation/radical-bar-visibility-expected-mismatch.html: Added. * mathml/presentation/radical-bar-visibility.html: Added. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@193743 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- LayoutTests/ChangeLog | 12 ++++++++ .../radical-bar-visibility-expected-mismatch.html | 17 +++++++++++ .../presentation/radical-bar-visibility.html | 34 ++++++++++++++++++++++ Source/WebCore/ChangeLog | 12 ++++++++ .../graphics/cairo/GraphicsContextCairo.cpp | 6 +++- 5 files changed, 80 insertions(+), 1 deletion(-) create mode 100644 LayoutTests/mathml/presentation/radical-bar-visibility-expected-mismatch.html create mode 100644 LayoutTests/mathml/presentation/radical-bar-visibility.html diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog index d6d3058..5ce00fc 100644 --- a/LayoutTests/ChangeLog +++ b/LayoutTests/ChangeLog @@ -1,3 +1,15 @@ +2015-12-08 Frederic Wang + + [cairo] Solid stroke of lines with thickness less than 1 pixel broken after r191658 + https://bugs.webkit.org/show_bug.cgi?id=151947 + + Reviewed by Martin Robinson. + + Add a test to check that the radical overbar appears on the screen when it has thickness less than 1px. + + * mathml/presentation/radical-bar-visibility-expected-mismatch.html: Added. + * mathml/presentation/radical-bar-visibility.html: Added. + 2015-12-07 Brady Eidson Move an IDB test from the "generic failure" section to the "fails because no workers" section. diff --git a/LayoutTests/mathml/presentation/radical-bar-visibility-expected-mismatch.html b/LayoutTests/mathml/presentation/radical-bar-visibility-expected-mismatch.html new file mode 100644 index 0000000..f9e10b6 --- /dev/null +++ b/LayoutTests/mathml/presentation/radical-bar-visibility-expected-mismatch.html @@ -0,0 +1,17 @@ + + + + Radical bar visibility + + + + +

This test passes if you see the radical bar.

+ +
+ +
+
+ + + diff --git a/LayoutTests/mathml/presentation/radical-bar-visibility.html b/LayoutTests/mathml/presentation/radical-bar-visibility.html new file mode 100644 index 0000000..a86b2e9 --- /dev/null +++ b/LayoutTests/mathml/presentation/radical-bar-visibility.html @@ -0,0 +1,34 @@ + + + + Radical bar visibility + + + + + +

This test passes if you see the radical bar.

+ +
+
+ + + + + +
+ +
+
+ + + diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog index 95b1170..962f77e 100644 --- a/Source/WebCore/ChangeLog +++ b/Source/WebCore/ChangeLog @@ -1,3 +1,15 @@ +2015-12-08 Frederic Wang + + [cairo] Solid stroke of lines with thickness less than 1 pixel broken after r191658 + https://bugs.webkit.org/show_bug.cgi?id=151947 + + Reviewed by Martin Robinson. + + Test: mathml/presentation/radical-bar-visibility.html + + * platform/graphics/cairo/GraphicsContextCairo.cpp: + (WebCore::GraphicsContext::drawLine): Force a minimal thickness of 1px + 2015-12-08 Gwang Yoon Hwang [ThreadedCompositor] Support WebGL for OpenGL. diff --git a/Source/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp b/Source/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp index 22c88ab..1e51c4b 100644 --- a/Source/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp +++ b/Source/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp @@ -311,8 +311,12 @@ void GraphicsContext::drawLine(const FloatPoint& point1, const FloatPoint& point } const double dashedLine[2] = { static_cast(patternWidth), static_cast(patternWidth) }; cairo_set_dash(cairoContext, dashedLine, 2, patternOffset); - } else + } else { setSourceRGBAFromColor(cairoContext, strokeColor); + if (thickness < 1) + cairo_set_line_width(cairoContext, 1); + } + FloatPoint p1 = point1; FloatPoint p2 = point2; -- 1.8.3.1