From 918f41bc73afec316429a2f596728c0c6ec86b11 Mon Sep 17 00:00:00 2001 From: ap Date: Tue, 29 Aug 2006 20:05:09 +0000 Subject: [PATCH] 2006-08-29 Nikolas Zimmermann Reviewed and landed by ap. Fixes: http://bugzilla.opendarwin.org/show_bug.cgi?id=10629. Drawing convex polygons is broken in the Qt platform. * platform/qt/GraphicsContextQt.cpp: (WebCore::GraphicsContext::drawConvexPolygon): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@16097 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- WebCore/ChangeLog | 10 ++++++++++ WebCore/platform/qt/GraphicsContextQt.cpp | 17 ++++++++++++++--- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog index 7fd2508c5d7d..04cd0aedeb54 100644 --- a/WebCore/ChangeLog +++ b/WebCore/ChangeLog @@ -1,3 +1,13 @@ +2006-08-29 Nikolas Zimmermann + + Reviewed and landed by ap. + + Fixes: http://bugzilla.opendarwin.org/show_bug.cgi?id=10629. + Drawing convex polygons is broken in the Qt platform. + + * platform/qt/GraphicsContextQt.cpp: + (WebCore::GraphicsContext::drawConvexPolygon): + 2006-08-29 Nikolas Zimmermann Reviewed by Eric. diff --git a/WebCore/platform/qt/GraphicsContextQt.cpp b/WebCore/platform/qt/GraphicsContextQt.cpp index 4c3880cdd9d4..80e615b31e4e 100644 --- a/WebCore/platform/qt/GraphicsContextQt.cpp +++ b/WebCore/platform/qt/GraphicsContextQt.cpp @@ -35,10 +35,11 @@ #include "GraphicsContext.h" #include "Path.h" +#include #include +#include #include #include -#include #ifndef M_PI #define M_PI 3.14159265358979323846 @@ -423,8 +424,18 @@ void GraphicsContext::drawConvexPolygon(size_t npoints, const FloatPoint* points if (paintingDisabled()) return; - // FIXME: Take 'shouldAntialias' into account... - m_data->p().drawConvexPolygon(reinterpret_cast(points), npoints); + if (npoints <= 1) + return; + + QPolygonF polygon(npoints); + + for (size_t i = 0; i < npoints; i++) + polygon << points[i]; + + m_data->p().save(); + m_data->p().setRenderHint(QPainter::Antialiasing, shouldAntialias); + m_data->p().drawConvexPolygon(polygon); + m_data->p().restore(); } void GraphicsContext::fillRect(const IntRect& rect, const Color& c) -- 2.36.0