https://bugs.webkit.org/show_bug.cgi?id=136413
Reviewed by Dan Bernstein.
No new tests, just cleanup.
* platform/graphics/GraphicsContext.cpp:
(WebCore::GraphicsContext::drawRaisedEllipse):
There's nothing iOS specific about this function.
* platform/graphics/GraphicsContext.h:
* platform/graphics/cairo/GraphicsContextCairo.cpp:
(WebCore::GraphicsContext::drawEllipse):
* platform/graphics/cg/GraphicsContextCG.cpp:
(WebCore::GraphicsContext::drawEllipse):
Un-ifdef drawRaisedEllipse; delete the reimplementation of drawEllipse that takes
a FloatRect and make the normal one take a FloatRect instead.
(WebCore::GraphicsContext::platformInit):
Make sure that the CGContext's line width starts out in sync with GraphicsContext's.
By default, CGContext has a line width of 1 and GraphicsContext 0, so they could previously
have been out of sync until someone set the width explicitly.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@173149
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2014-08-31 Tim Horton <timothy_horton@apple.com>
+
+ Remove duplicate implementation of drawEllipse and some related PLATFORM(IOS) ifdefs
+ https://bugs.webkit.org/show_bug.cgi?id=136413
+
+ Reviewed by Dan Bernstein.
+
+ No new tests, just cleanup.
+
+ * platform/graphics/GraphicsContext.cpp:
+ (WebCore::GraphicsContext::drawRaisedEllipse):
+ There's nothing iOS specific about this function.
+
+ * platform/graphics/GraphicsContext.h:
+ * platform/graphics/cairo/GraphicsContextCairo.cpp:
+ (WebCore::GraphicsContext::drawEllipse):
+ * platform/graphics/cg/GraphicsContextCG.cpp:
+ (WebCore::GraphicsContext::drawEllipse):
+ Un-ifdef drawRaisedEllipse; delete the reimplementation of drawEllipse that takes
+ a FloatRect and make the normal one take a FloatRect instead.
+
+ (WebCore::GraphicsContext::platformInit):
+ Make sure that the CGContext's line width starts out in sync with GraphicsContext's.
+ By default, CGContext has a line width of 1 and GraphicsContext 0, so they could previously
+ have been out of sync until someone set the width explicitly.
+
2014-08-31 Tim Horton <timothy_horton@apple.com>
Fix a harmless mismerge in BitmapImage::destroyDecodedDataIfNecessary
restorePlatformState();
}
-#if PLATFORM(IOS)
void GraphicsContext::drawRaisedEllipse(const FloatRect& rect, const Color& ellipseColor, ColorSpace ellipseColorSpace, const Color& shadowColor, ColorSpace shadowColorSpace)
{
if (paintingDisabled())
restore();
}
-#endif
void GraphicsContext::setStrokeThickness(float thickness)
{
void drawJoinedLines(CGPoint points[], unsigned count, bool antialias, CGLineCap = kCGLineCapButt);
#endif
- void drawEllipse(const IntRect&);
-#if PLATFORM(IOS)
void drawEllipse(const FloatRect&);
void drawRaisedEllipse(const FloatRect&, const Color& ellipseColor, ColorSpace ellipseColorSpace, const Color& shadowColor, ColorSpace shadowColorSpace);
-#endif
void drawConvexPolygon(size_t numPoints, const FloatPoint*, bool shouldAntialias = false);
WEBCORE_EXPORT void fillPath(const Path&);
}
// This method is only used to draw the little circles used in lists.
-void GraphicsContext::drawEllipse(const IntRect& rect)
+void GraphicsContext::drawEllipse(const FloatRect& rect)
{
if (paintingDisabled())
return;
// Make sure the context starts in sync with our state.
setPlatformFillColor(fillColor(), fillColorSpace());
setPlatformStrokeColor(strokeColor(), strokeColorSpace());
+ setPlatformStrokeThickness(strokeThickness());
#if PLATFORM(IOS)
}
#endif
}
#endif
-// This method is only used to draw the little circles used in lists.
-void GraphicsContext::drawEllipse(const IntRect& rect)
+void GraphicsContext::drawEllipse(const FloatRect& rect)
{
if (paintingDisabled())
return;
drawPath(path);
}
-#if PLATFORM(IOS)
-void GraphicsContext::drawEllipse(const FloatRect& rect)
-{
- if (paintingDisabled())
- return;
-
- CGContextRef context(platformContext());
-
- CGContextSaveGState(context);
-
- setCGFillColor(context, fillColor(), fillColorSpace());
- setCGStrokeColor(context, strokeColor(), strokeColorSpace());
-
- CGContextSetLineWidth(context, strokeThickness());
-
- CGContextBeginPath(context);
- CGContextAddEllipseInRect(context, rect);
-
- CGContextFillPath(context);
- CGContextStrokePath(context);
-
- CGContextRestoreGState(context);
-}
-#endif
-
static void addConvexPolygonToPath(Path& path, size_t numberOfPoints, const FloatPoint* points)
{
ASSERT(numberOfPoints > 0);