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

Unified Diff: Source/core/rendering/svg/RenderSVGShape.cpp

Issue 261773008: [SVG2] css 'outline' property should apply to svg elements (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: use Ahem instead Created 6 years, 7 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/rendering/svg/RenderSVGRoot.cpp ('k') | Source/core/rendering/svg/RenderSVGText.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/svg/RenderSVGShape.cpp
diff --git a/Source/core/rendering/svg/RenderSVGShape.cpp b/Source/core/rendering/svg/RenderSVGShape.cpp
index 4ae25aa81ac239a132465f6a85a39eb39b537d94..b7b1bf335aca9bde40d2060a72995307ae37b971 100644
--- a/Source/core/rendering/svg/RenderSVGShape.cpp
+++ b/Source/core/rendering/svg/RenderSVGShape.cpp
@@ -235,61 +235,60 @@ void RenderSVGShape::strokeShape(RenderStyle* style, GraphicsContext* context)
void RenderSVGShape::paint(PaintInfo& paintInfo, const LayoutPoint&)
{
ANNOTATE_GRAPHICS_CONTEXT(paintInfo, this);
-
- if (paintInfo.context->paintingDisabled() || style()->visibility() == HIDDEN || isShapeEmpty())
+ if (paintInfo.context->paintingDisabled()
+ || paintInfo.phase != PaintPhaseForeground
+ || style()->visibility() == HIDDEN
+ || isShapeEmpty())
return;
+
FloatRect boundingBox = repaintRectInLocalCoordinates();
if (!SVGRenderSupport::paintInfoIntersectsRepaintRect(boundingBox, m_localTransform, paintInfo))
return;
PaintInfo childPaintInfo(paintInfo);
- bool drawsOutline = style()->outlineWidth() && (childPaintInfo.phase == PaintPhaseOutline || childPaintInfo.phase == PaintPhaseSelfOutline);
- if (drawsOutline || childPaintInfo.phase == PaintPhaseForeground) {
- GraphicsContextStateSaver stateSaver(*childPaintInfo.context);
- childPaintInfo.applyTransform(m_localTransform);
-
- if (childPaintInfo.phase == PaintPhaseForeground) {
- SVGRenderingContext renderingContext(this, childPaintInfo);
-
- if (renderingContext.isRenderingPrepared()) {
- const SVGRenderStyle* svgStyle = style()->svgStyle();
- if (svgStyle->shapeRendering() == SR_CRISPEDGES)
- childPaintInfo.context->setShouldAntialias(false);
-
- for (int i = 0; i < 3; i++) {
- switch (svgStyle->paintOrderType(i)) {
- case PT_FILL:
- fillShape(this->style(), childPaintInfo.context);
- break;
- case PT_STROKE:
- if (svgStyle->hasVisibleStroke()) {
- GraphicsContextStateSaver stateSaver(*childPaintInfo.context, false);
- AffineTransform nonScalingTransform;
-
- if (hasNonScalingStroke()) {
- AffineTransform nonScalingTransform = nonScalingStrokeTransform();
- if (!setupNonScalingStrokeContext(nonScalingTransform, stateSaver))
- return;
- }
-
- strokeShape(this->style(), childPaintInfo.context);
- }
- break;
- case PT_MARKERS:
- if (!m_markerPositions.isEmpty())
- drawMarkers(childPaintInfo);
- break;
- default:
- ASSERT_NOT_REACHED();
- break;
+
+ GraphicsContextStateSaver stateSaver(*childPaintInfo.context);
+ childPaintInfo.applyTransform(m_localTransform);
+
+ SVGRenderingContext renderingContext(this, childPaintInfo);
+
+ if (renderingContext.isRenderingPrepared()) {
+ const SVGRenderStyle* svgStyle = style()->svgStyle();
+ if (svgStyle->shapeRendering() == SR_CRISPEDGES)
+ childPaintInfo.context->setShouldAntialias(false);
+
+ for (int i = 0; i < 3; i++) {
+ switch (svgStyle->paintOrderType(i)) {
+ case PT_FILL:
+ fillShape(this->style(), childPaintInfo.context);
+ break;
+ case PT_STROKE:
+ if (svgStyle->hasVisibleStroke()) {
+ GraphicsContextStateSaver stateSaver(*childPaintInfo.context, false);
+ AffineTransform nonScalingTransform;
+
+ if (hasNonScalingStroke()) {
+ AffineTransform nonScalingTransform = nonScalingStrokeTransform();
+ if (!setupNonScalingStrokeContext(nonScalingTransform, stateSaver))
+ return;
}
+
+ strokeShape(this->style(), childPaintInfo.context);
}
+ break;
+ case PT_MARKERS:
+ if (!m_markerPositions.isEmpty())
+ drawMarkers(childPaintInfo);
+ break;
+ default:
+ ASSERT_NOT_REACHED();
+ break;
}
}
-
- if (drawsOutline)
- paintOutline(childPaintInfo, IntRect(boundingBox));
}
+
+ if (style()->outlineWidth())
+ paintOutline(childPaintInfo, IntRect(boundingBox));
}
// This method is called from inside paintOutline() since we call paintOutline()
« no previous file with comments | « Source/core/rendering/svg/RenderSVGRoot.cpp ('k') | Source/core/rendering/svg/RenderSVGText.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698