| Index: Source/platform/graphics/GraphicsContext.cpp
|
| diff --git a/Source/platform/graphics/GraphicsContext.cpp b/Source/platform/graphics/GraphicsContext.cpp
|
| index 94c921c84c89aa8f4ee082bf24142f36ebb92095..17ad09ddb8bcb046651fe95724a825c25f78e275 100644
|
| --- a/Source/platform/graphics/GraphicsContext.cpp
|
| +++ b/Source/platform/graphics/GraphicsContext.cpp
|
| @@ -767,7 +767,6 @@ void GraphicsContext::drawInnerShadow(const RoundedRect& rect, const Color& shad
|
| clearDrawLooper();
|
| }
|
|
|
| -// This is only used to draw borders.
|
| void GraphicsContext::drawLine(const IntPoint& point1, const IntPoint& point2)
|
| {
|
| if (paintingDisabled())
|
| @@ -955,32 +954,35 @@ void GraphicsContext::drawLineForText(const FloatPoint& pt, float width, bool pr
|
| if (width <= 0)
|
| return;
|
|
|
| - int thickness = SkMax32(static_cast<int>(strokeThickness()), 1);
|
| - SkRect r;
|
| - r.fLeft = WebCoreFloatToSkScalar(pt.x());
|
| - // Avoid anti-aliasing lines. Currently, these are always horizontal.
|
| - // Round to nearest pixel to match text and other content.
|
| - r.fTop = WebCoreFloatToSkScalar(floorf(pt.y() + 0.5f));
|
| - r.fRight = r.fLeft + WebCoreFloatToSkScalar(width);
|
| - r.fBottom = r.fTop + SkIntToScalar(thickness);
|
| -
|
| SkPaint paint;
|
| switch (strokeStyle()) {
|
| case NoStroke:
|
| case SolidStroke:
|
| case DoubleStroke:
|
| - case WavyStroke:
|
| + case WavyStroke: {
|
| + int thickness = SkMax32(static_cast<int>(strokeThickness()), 1);
|
| + SkRect r;
|
| + r.fLeft = WebCoreFloatToSkScalar(pt.x());
|
| + // Avoid anti-aliasing lines. Currently, these are always horizontal.
|
| + // Round to nearest pixel to match text and other content.
|
| + r.fTop = WebCoreFloatToSkScalar(floorf(pt.y() + 0.5f));
|
| + r.fRight = r.fLeft + WebCoreFloatToSkScalar(width);
|
| + r.fBottom = r.fTop + SkIntToScalar(thickness);
|
| setupPaintForFilling(&paint);
|
| - break;
|
| + // Text lines are drawn using the stroke color.
|
| + paint.setColor(effectiveStrokeColor());
|
| + drawRect(r, paint);
|
| + return;
|
| + }
|
| case DottedStroke:
|
| - case DashedStroke:
|
| - setupPaintForStroking(&paint);
|
| - break;
|
| + case DashedStroke: {
|
| + int y = floorf(pt.y() + std::max<float>(strokeThickness() / 2.0f, 0.5f));
|
| + drawLine(IntPoint(pt.x(), y), IntPoint(pt.x() + width, y));
|
| + return;
|
| + }
|
| }
|
|
|
| - // Text lines are drawn using the stroke color.
|
| - paint.setColor(effectiveStrokeColor());
|
| - drawRect(r, paint);
|
| + ASSERT_NOT_REACHED();
|
| }
|
|
|
| // Draws a filled rectangle with a stroked border.
|
|
|