WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
patch to use CoreGraphics directly instead of using NSBezierPath
BezierPathPatch.txt (text/plain), 2.99 KB, created by
Darin Adler
on 2005-08-13 23:00:17 PDT
(
hide
)
Description:
patch to use CoreGraphics directly instead of using NSBezierPath
Filename:
MIME Type:
Creator:
Darin Adler
Created:
2005-08-13 23:00:17 PDT
Size:
2.99 KB
patch
obsolete
>Index: WebCore/kwq/KWQPainter.mm >=================================================================== >RCS file: /cvs/root/WebCore/kwq/KWQPainter.mm,v >retrieving revision 1.127 >diff -p -u -r1.127 WebCore/kwq/KWQPainter.mm >--- WebCore/kwq/KWQPainter.mm 7 Jul 2005 08:03:22 -0000 1.127 >+++ WebCore/kwq/KWQPainter.mm 26 Jul 2005 04:24:39 -0000 >@@ -394,54 +394,54 @@ void QPainter::drawLineSegments(const QP > if (data->state.paintingDisabled) > return; > >- _drawPoints (points, 0, index, nlines, false); >+ _drawPoints(points, 0, index, nlines, false); > } > > void QPainter::drawPolyline(const QPointArray &points, int index, int npoints) > { >- _drawPoints (points, 0, index, npoints, false); >+ _drawPoints(points, 0, index, npoints, false); > } > >-void QPainter::drawPolygon(const QPointArray &points, bool winding, int index, >- int npoints) >+void QPainter::drawPolygon(const QPointArray &points, bool winding, int index, int npoints) > { >- _drawPoints (points, winding, index, npoints, true); >+ _drawPoints(points, winding, index, npoints, true); > } > > void QPainter::drawConvexPolygon(const QPointArray &points) > { >- _drawPoints (points, false, 0, -1, true); >+ _drawPoints(points, false, 0, -1, true); > } > >-void QPainter::_drawPoints (const QPointArray &_points, bool winding, int index, int _npoints, bool fill) >+void QPainter::_drawPoints(const QPointArray &_points, bool winding, int index, int _npoints, bool fill) > { > if (data->state.paintingDisabled) > return; > >- int npoints = _npoints != -1 ? _npoints : _points.size()-index; >- NSPoint points[npoints]; >- for (int i = 0; i < npoints; i++) { >- points[i].x = _points[index+i].x(); >- points[i].y = _points[index+i].y(); >- } >- >- NSBezierPath *path = [[NSBezierPath alloc] init]; >- [path appendBezierPathWithPoints:&points[0] count:npoints]; >- [path closePath]; // Qt always closes the path. Determined empirically. >- >+ int npoints = _npoints != -1 ? _npoints : _points.size() - index; >+ if (npoints <= 1) >+ return; >+ >+ CGContextRef context = (CGContextRef)[[NSGraphicsContext currentContext] graphicsPort]; >+ >+ CGContextBeginPath(context); >+ CGContextMoveToPoint(context, _points[0].x(), _points[0].y()); >+ for (int i = 1; i < npoints; i++) >+ CGContextAddLineToPoint(context, _points[i].x(), _points[i].y()); >+ CGContextClosePath(context); >+ > if (fill && data->state.brush.style() != NoBrush) { >- [path setWindingRule:winding ? NSNonZeroWindingRule : NSEvenOddWindingRule]; > _setColorFromBrush(); >- [path fill]; >+ if (winding) >+ CGContextFillPath(context); >+ else >+ CGContextEOFillPath(context); > } > > if (data->state.pen.style() != NoPen) { > _setColorFromPen(); >- [path setLineWidth:data->state.pen.width()]; >- [path stroke]; >+ CGContextSetLineWidth(context, data->state.pen.width()); >+ CGContextStrokePath(context); > } >- >- [path release]; > } > >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
mjs
:
review+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 4420
: 3368