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
+2006-08-29 Nikolas Zimmermann <zimmermann@kde.org>
+
+ 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 <zimmermann@kde.org>
Reviewed by Eric.
#include "GraphicsContext.h"
#include "Path.h"
+#include <QStack>
#include <QPainter>
+#include <QPolygonF>
#include <QPainterPath>
#include <QPaintDevice>
-#include <QStack>
#ifndef M_PI
#define M_PI 3.14159265358979323846
if (paintingDisabled())
return;
- // FIXME: Take 'shouldAntialias' into account...
- m_data->p().drawConvexPolygon(reinterpret_cast<const QPointF*>(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)