Diff
Modified: trunk/Source/WebCore/ChangeLog (149565 => 149566)
--- trunk/Source/WebCore/ChangeLog 2013-05-04 20:10:12 UTC (rev 149565)
+++ trunk/Source/WebCore/ChangeLog 2013-05-04 20:22:01 UTC (rev 149566)
@@ -1,5 +1,20 @@
2013-05-04 Andreas Kling <[email protected]>
+ Remove GraphicsContext::strokeArc(), which is unused.
+
+ From Blink r149608 by <[email protected]>
+ <http://src.chromium.org/viewvc/blink?view=revision&revision=149608>
+
+ This is no longer used since almost a year ago, when HAVE(PATH_BASED_BORDER_RADIUS_DRAWING) was inlined.
+
+ * platform/graphics/GraphicsContext.h:
+ * platform/graphics/blackberry/GraphicsContextBlackBerry.cpp:
+ * platform/graphics/cairo/GraphicsContextCairo.cpp:
+ * platform/graphics/cg/GraphicsContextCG.cpp:
+ * platform/graphics/wince/GraphicsContextWinCE.cpp:
+
+2013-05-04 Andreas Kling <[email protected]>
+
Remove unused CSSSelector::isCustomPseudoType().
From Blink r149574 by <[email protected]>
Modified: trunk/Source/WebCore/platform/graphics/GraphicsContext.h (149565 => 149566)
--- trunk/Source/WebCore/platform/graphics/GraphicsContext.h 2013-05-04 20:10:12 UTC (rev 149565)
+++ trunk/Source/WebCore/platform/graphics/GraphicsContext.h 2013-05-04 20:22:01 UTC (rev 149566)
@@ -268,9 +268,6 @@
void fillEllipse(const FloatRect&);
void strokeEllipse(const FloatRect&);
- // Arc drawing (used by border-radius in CSS) just supports stroking at the moment.
- void strokeArc(const IntRect&, int startAngle, int angleSpan);
-
void fillRect(const FloatRect&);
void fillRect(const FloatRect&, const Color&, ColorSpace);
void fillRect(const FloatRect&, Generator&);
Modified: trunk/Source/WebCore/platform/graphics/blackberry/GraphicsContextBlackBerry.cpp (149565 => 149566)
--- trunk/Source/WebCore/platform/graphics/blackberry/GraphicsContextBlackBerry.cpp 2013-05-04 20:10:12 UTC (rev 149565)
+++ trunk/Source/WebCore/platform/graphics/blackberry/GraphicsContextBlackBerry.cpp 2013-05-04 20:22:01 UTC (rev 149566)
@@ -166,14 +166,6 @@
platformContext()->addEllipse(FloatRect(rect));
}
-void GraphicsContext::strokeArc(const IntRect& rect, int startAngle, int angleSpan)
-{
- if (paintingDisabled())
- return;
-
- platformContext()->addArc(rect, startAngle, angleSpan);
-}
-
void GraphicsContext::drawConvexPolygon(size_t numPoints, const FloatPoint* points, bool)
{
if (paintingDisabled())
Modified: trunk/Source/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp (149565 => 149566)
--- trunk/Source/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp 2013-05-04 20:10:12 UTC (rev 149565)
+++ trunk/Source/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp 2013-05-04 20:22:01 UTC (rev 149566)
@@ -365,63 +365,6 @@
cairo_new_path(cr);
}
-void GraphicsContext::strokeArc(const IntRect& rect, int startAngle, int angleSpan)
-{
- if (paintingDisabled() || strokeStyle() == NoStroke)
- return;
-
- int x = rect.x();
- int y = rect.y();
- float w = rect.width();
- float h = rect.height();
- float scaleFactor = h / w;
- float reverseScaleFactor = w / h;
-
- float hRadius = w / 2;
- float vRadius = h / 2;
- float fa = startAngle;
- float falen = fa + angleSpan;
-
- cairo_t* cr = platformContext()->cr();
- cairo_save(cr);
-
- if (w != h)
- cairo_scale(cr, 1., scaleFactor);
-
- cairo_arc_negative(cr, x + hRadius, (y + vRadius) * reverseScaleFactor, hRadius, deg2rad(-fa), deg2rad(-falen));
-
- if (w != h)
- cairo_scale(cr, 1., reverseScaleFactor);
-
- int patternWidth = 0;
- switch (strokeStyle()) {
- case DottedStroke:
- patternWidth = floorf(strokeThickness() / 2.f);
- break;
- case DashedStroke:
- patternWidth = 3 * floorf(strokeThickness() / 2.f);
- break;
- default:
- break;
- }
-
- setSourceRGBAFromColor(cr, strokeColor());
-
- if (patternWidth) {
- float distance = 0;
- if (hRadius == vRadius)
- distance = (piFloat * hRadius) / 2.f;
- else // We are elliptical and will have to estimate the distance
- distance = (piFloat * sqrtf((hRadius * hRadius + vRadius * vRadius) / 2.f)) / 2.f;
- double patternOffset = calculateStrokePatternOffset(floorf(distance), patternWidth);
- double patternWidthAsDouble = patternWidth;
- cairo_set_dash(cr, &patternWidthAsDouble, 1, patternOffset);
- }
-
- cairo_stroke(cr);
- cairo_restore(cr);
-}
-
void GraphicsContext::drawConvexPolygon(size_t npoints, const FloatPoint* points, bool shouldAntialias)
{
if (paintingDisabled())
Modified: trunk/Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp (149565 => 149566)
--- trunk/Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp 2013-05-04 20:10:12 UTC (rev 149565)
+++ trunk/Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp 2013-05-04 20:22:01 UTC (rev 149566)
@@ -412,95 +412,6 @@
drawPath(path);
}
-
-void GraphicsContext::strokeArc(const IntRect& rect, int startAngle, int angleSpan)
-{
- if (paintingDisabled() || strokeStyle() == NoStroke || strokeThickness() <= 0.0f)
- return;
-
- CGContextRef context = platformContext();
- CGContextSaveGState(context);
- CGContextBeginPath(context);
- CGContextSetShouldAntialias(context, false);
-
- int x = rect.x();
- int y = rect.y();
- float w = (float)rect.width();
- float h = (float)rect.height();
- float scaleFactor = h / w;
- float reverseScaleFactor = w / h;
-
- if (w != h)
- scale(FloatSize(1, scaleFactor));
-
- float hRadius = w / 2;
- float vRadius = h / 2;
- float fa = startAngle;
- float falen = fa + angleSpan;
- float start = -fa * piFloat / 180.0f;
- float end = -falen * piFloat / 180.0f;
- CGContextAddArc(context, x + hRadius, (y + vRadius) * reverseScaleFactor, hRadius, start, end, true);
-
- if (w != h)
- scale(FloatSize(1, reverseScaleFactor));
-
- float width = strokeThickness();
- int patWidth = 0;
-
- switch (strokeStyle()) {
- case DottedStroke:
- patWidth = (int)(width / 2);
- break;
- case DashedStroke:
- patWidth = 3 * (int)(width / 2);
- break;
- default:
- break;
- }
-
- if (patWidth) {
- // Example: 80 pixels with a width of 30 pixels.
- // Remainder is 20. The maximum pixels of line we could paint
- // will be 50 pixels.
- int distance;
- if (hRadius == vRadius)
- distance = static_cast<int>((piFloat * hRadius) / 2.0f);
- else // We are elliptical and will have to estimate the distance
- distance = static_cast<int>((piFloat * sqrtf((hRadius * hRadius + vRadius * vRadius) / 2.0f)) / 2.0f);
-
- int remainder = distance % patWidth;
- int coverage = distance - remainder;
- int numSegments = coverage / patWidth;
-
- float patternOffset = 0.0f;
- // Special case 1px dotted borders for speed.
- if (patWidth == 1)
- patternOffset = 1.0f;
- else {
- bool evenNumberOfSegments = !(numSegments % 2);
- if (remainder)
- evenNumberOfSegments = !evenNumberOfSegments;
- if (evenNumberOfSegments) {
- if (remainder) {
- patternOffset += patWidth - remainder;
- patternOffset += remainder / 2.0f;
- } else
- patternOffset = patWidth / 2.0f;
- } else {
- if (remainder)
- patternOffset = (patWidth - remainder) / 2.0f;
- }
- }
-
- const CGFloat dottedLine[2] = { static_cast<CGFloat>(patWidth), static_cast<CGFloat>(patWidth) };
- CGContextSetLineDash(context, patternOffset, dottedLine, 2);
- }
-
- CGContextStrokePath(context);
-
- CGContextRestoreGState(context);
-}
-
static void addConvexPolygonToPath(Path& path, size_t numberOfPoints, const FloatPoint* points)
{
ASSERT(numberOfPoints > 0);
Modified: trunk/Source/WebCore/platform/graphics/wince/GraphicsContextWinCE.cpp (149565 => 149566)
--- trunk/Source/WebCore/platform/graphics/wince/GraphicsContextWinCE.cpp 2013-05-04 20:10:12 UTC (rev 149565)
+++ trunk/Source/WebCore/platform/graphics/wince/GraphicsContextWinCE.cpp 2013-05-04 20:22:01 UTC (rev 149566)
@@ -783,81 +783,6 @@
}
}
-void GraphicsContext::strokeArc(const IntRect& rect, int startAngle, int angleSpan)
-{
- if (!m_data->m_opacity || paintingDisabled() || strokeStyle() == NoStroke || rect.isEmpty())
- return;
-
- ScopeDCProvider dcProvider(m_data);
- if (!m_data->m_dc)
- return;
-
- IntRect trRect = m_data->mapRect(rect);
- TransparentLayerDC transparentDC(m_data, trRect, &rect);
- HDC dc = transparentDC.hdc();
- if (!dc)
- return;
- trRect.move(transparentDC.toShift());
-
- OwnPtr<HPEN> pen = createPen(strokeColor(), strokeThickness(), strokeStyle());
- HGDIOBJ oldPen = SelectObject(dc, pen.get());
-
- double a = trRect.width() * 0.5;
- double b = trRect.height() * 0.5;
- int centerX = stableRound(trRect.x() + a);
- int centerY = stableRound(trRect.y() + b);
- float fstartX, fstartY, fendX, fendY;
- int startX, startY, endX, endY;
- getEllipsePointByAngle(deg2rad((double)startAngle), a, b, fstartX, fstartY);
- getEllipsePointByAngle(deg2rad((double)startAngle + angleSpan), a, b, fendX, fendY);
- startX = stableRound(fstartX);
- startY = stableRound(fstartY);
- endX = stableRound(fendX);
- endY = stableRound(fendY);
-
- startX += centerX;
- startY = centerY - startY;
- endX += centerX;
- endY = centerY - endY;
- RECT clipRect;
- if (startX < endX) {
- clipRect.left = startX;
- clipRect.right = endX;
- } else {
- clipRect.left = endX;
- clipRect.right = startX;
- }
- if (startY < endY) {
- clipRect.top = startY;
- clipRect.bottom = endY;
- } else {
- clipRect.top = endY;
- clipRect.bottom = startY;
- }
-
- OwnPtr<HRGN> clipRgn = adoptPtr(CreateRectRgn(0, 0, 0, 0));
- bool newClip;
- if (GetClipRgn(dc, clipRgn.get()) <= 0) {
- newClip = true;
- clipRgn = adoptPtr(CreateRectRgn(clipRect.left, clipRect.top, clipRect.right, clipRect.bottom));
- SelectClipRgn(dc, clipRgn.get());
- } else {
- newClip = false;
- IntersectClipRect(dc, clipRect.left, clipRect.top, clipRect.right, clipRect.bottom);
- }
-
- HGDIOBJ oldBrush = SelectObject(dc, GetStockObject(NULL_BRUSH));
- Ellipse(dc, trRect.x(), trRect.y(), trRect.maxX(), trRect.maxY());
- SelectObject(dc, oldBrush);
-
- if (newClip)
- SelectClipRgn(dc, 0);
- else
- SelectClipRgn(dc, clipRgn.get());
-
- SelectObject(dc, oldPen);
-}
-
void GraphicsContext::drawConvexPolygon(size_t npoints, const FloatPoint* points, bool shouldAntialias)
{
if (!m_data->m_opacity || paintingDisabled() || npoints <= 1 || !points)