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

Side by Side Diff: Source/core/paint/SVGMarkerPainter.cpp

Issue 693313003: Factor SVGMarkerPainter into SVGShapePainter (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/paint/SVGMarkerPainter.h ('k') | Source/core/paint/SVGShapePainter.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "config.h"
6 #include "core/paint/SVGMarkerPainter.h"
7
8 #include "core/paint/SVGContainerPainter.h"
9 #include "core/rendering/PaintInfo.h"
10 #include "core/rendering/svg/RenderSVGResourceMarker.h"
11 #include "core/rendering/svg/SVGMarkerData.h"
12 #include "core/rendering/svg/SVGRenderSupport.h"
13 #include "platform/graphics/GraphicsContextStateSaver.h"
14
15 namespace blink {
16
17 void SVGMarkerPainter::paint(PaintInfo& paintInfo, const MarkerPosition& positio n, float strokeWidth)
18 {
19 // An empty viewBox disables rendering.
20 SVGMarkerElement* marker = toSVGMarkerElement(m_renderSVGMarker.element());
21 ASSERT(marker);
22 if (marker->hasAttribute(SVGNames::viewBoxAttr) && marker->viewBox()->curren tValue()->isValid() && marker->viewBox()->currentValue()->value().isEmpty())
23 return;
24
25 PaintInfo info(paintInfo);
26 GraphicsContextStateSaver stateSaver(*info.context, false);
27 info.applyTransform(m_renderSVGMarker.markerTransformation(position.origin, position.angle, strokeWidth), &stateSaver);
28
29 if (SVGRenderSupport::isOverflowHidden(&m_renderSVGMarker)) {
30 stateSaver.saveIfNeeded();
31 info.context->clip(m_renderSVGMarker.viewport());
32 }
33
34 SVGContainerPainter(m_renderSVGMarker).paint(info);
35 }
36
37 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/paint/SVGMarkerPainter.h ('k') | Source/core/paint/SVGShapePainter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698