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

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

Issue 22482004: Add support for the object-fit CSS property. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase for landing Created 7 years, 4 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/RenderSVGShape.h ('k') | Source/core/rendering/svg/SVGInlineTextBox.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 522f7abf5ffe19131d9a163d20e542713007f5c8..5156aa5209ea523fa93ef7f7800934cdf825b03a 100644
--- a/Source/core/rendering/svg/RenderSVGShape.cpp
+++ b/Source/core/rendering/svg/RenderSVGShape.cpp
@@ -243,26 +243,6 @@ void RenderSVGShape::strokeShape(RenderStyle* style, GraphicsContext* context)
}
}
-void RenderSVGShape::fillAndStrokeShape(GraphicsContext* context)
-{
- RenderStyle* style = this->style();
-
- fillShape(style, context);
-
- if (!style->svgStyle()->hasVisibleStroke())
- return;
-
- GraphicsContextStateSaver stateSaver(*context, false);
-
- if (hasNonScalingStroke()) {
- AffineTransform nonScalingTransform = nonScalingStrokeTransform();
- if (!setupNonScalingStrokeContext(nonScalingTransform, stateSaver))
- return;
- }
-
- strokeShape(style, context);
-}
-
void RenderSVGShape::paint(PaintInfo& paintInfo, const LayoutPoint&)
{
ANNOTATE_GRAPHICS_CONTEXT(paintInfo, this);
@@ -287,9 +267,34 @@ void RenderSVGShape::paint(PaintInfo& paintInfo, const LayoutPoint&)
if (svgStyle->shapeRendering() == SR_CRISPEDGES)
childPaintInfo.context->setShouldAntialias(false);
- fillAndStrokeShape(childPaintInfo.context);
- if (!m_markerPositions.isEmpty())
- drawMarkers(childPaintInfo);
+ 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;
+ }
+ }
}
}
« no previous file with comments | « Source/core/rendering/svg/RenderSVGShape.h ('k') | Source/core/rendering/svg/SVGInlineTextBox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698