Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1232)

Unified Diff: Source/core/paint/SVGShapePainter.cpp

Issue 1328693002: Drop special-case handling of zero-length subpaths (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase; TEs. Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/paint/SVGShapePainter.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/paint/SVGShapePainter.cpp
diff --git a/Source/core/paint/SVGShapePainter.cpp b/Source/core/paint/SVGShapePainter.cpp
index 72fc90c8f0efeb473e1eed0c32acce78ae93cf17..f509a7fec260766102838626475a334221db6aaf 100644
--- a/Source/core/paint/SVGShapePainter.cpp
+++ b/Source/core/paint/SVGShapePainter.cpp
@@ -5,7 +5,6 @@
#include "config.h"
#include "core/paint/SVGShapePainter.h"
-#include "core/layout/svg/LayoutSVGPath.h"
#include "core/layout/svg/LayoutSVGResourceMarker.h"
#include "core/layout/svg/LayoutSVGShape.h"
#include "core/layout/svg/SVGLayoutSupport.h"
@@ -173,7 +172,6 @@ void SVGShapePainter::strokeShape(GraphicsContext* context, const SkPaint& paint
if (m_layoutSVGShape.hasNonScalingStroke())
usePath = m_layoutSVGShape.nonScalingStrokePath(usePath, m_layoutSVGShape.nonScalingStrokeTransform());
context->drawPath(usePath->skPath(), paint);
- strokeZeroLengthLineCaps(context, paint);
}
}
@@ -229,35 +227,4 @@ void SVGShapePainter::paintMarker(const PaintInfo& paintInfo, LayoutSVGResourceM
SVGContainerPainter(marker).paint(paintInfo);
}
-void SVGShapePainter::strokeZeroLengthLineCaps(GraphicsContext* context, const SkPaint& strokePaint)
-{
- const Vector<FloatPoint>* zeroLengthLineCaps = m_layoutSVGShape.zeroLengthLineCaps();
- if (!zeroLengthLineCaps || zeroLengthLineCaps->isEmpty())
- return;
-
- // We need a paint for filling.
- SkPaint fillPaint = strokePaint;
- fillPaint.setStyle(SkPaint::kFill_Style);
-
- AffineTransform nonScalingTransform;
- bool hasNonScalingStroke = m_layoutSVGShape.hasNonScalingStroke();
- if (hasNonScalingStroke)
- nonScalingTransform = m_layoutSVGShape.nonScalingStrokeTransform();
-
- for (const FloatPoint& capPosition : *zeroLengthLineCaps) {
- FloatPoint position = capPosition;
- // If non-scaling-stroke is in effect, apply the transform to the
- // position (being the non-stroke geometry), and then paint the
- // requested shape. The CTM should've been adjusted in
- // SVGShapePainter::paint.
- if (hasNonScalingStroke)
- position = nonScalingTransform.mapPoint(position);
- FloatRect subpathRect = LayoutSVGPath::zeroLengthSubpathRect(position, m_layoutSVGShape.strokeWidth());
- if (m_layoutSVGShape.style()->svgStyle().capStyle() == SquareCap)
- context->drawRect(subpathRect, fillPaint);
- else
- context->drawOval(subpathRect, fillPaint);
- }
-}
-
} // namespace blink
« no previous file with comments | « Source/core/paint/SVGShapePainter.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698