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

Side by Side Diff: Source/core/rendering/svg/SVGResources.cpp

Issue 18233024: Use toSVGFilterElement instead of static_cast<..> (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 5 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 2 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 } 140 }
141 141
142 static inline String targetReferenceFromResource(SVGElement* element) 142 static inline String targetReferenceFromResource(SVGElement* element)
143 { 143 {
144 String target; 144 String target;
145 if (element->hasTagName(SVGNames::patternTag)) 145 if (element->hasTagName(SVGNames::patternTag))
146 target = static_cast<SVGPatternElement*>(element)->hrefCurrentValue(); 146 target = static_cast<SVGPatternElement*>(element)->hrefCurrentValue();
147 else if (element->hasTagName(SVGNames::linearGradientTag) || element->hasTag Name(SVGNames::radialGradientTag)) 147 else if (element->hasTagName(SVGNames::linearGradientTag) || element->hasTag Name(SVGNames::radialGradientTag))
148 target = static_cast<SVGGradientElement*>(element)->hrefCurrentValue(); 148 target = static_cast<SVGGradientElement*>(element)->hrefCurrentValue();
149 else if (element->hasTagName(SVGNames::filterTag)) 149 else if (element->hasTagName(SVGNames::filterTag))
150 target = static_cast<SVGFilterElement*>(element)->hrefCurrentValue(); 150 target = toSVGFilterElement(element)->hrefCurrentValue();
151 else 151 else
152 ASSERT_NOT_REACHED(); 152 ASSERT_NOT_REACHED();
153 153
154 return SVGURIReference::fragmentIdentifierFromIRIString(target, element->doc ument()); 154 return SVGURIReference::fragmentIdentifierFromIRIString(target, element->doc ument());
155 } 155 }
156 156
157 static inline RenderSVGResourceContainer* paintingResourceFromSVGPaint(Document* document, const SVGPaint::SVGPaintType& paintType, const String& paintUri, Atom icString& id, bool& hasPendingResource) 157 static inline RenderSVGResourceContainer* paintingResourceFromSVGPaint(Document* document, const SVGPaint::SVGPaintType& paintType, const String& paintUri, Atom icString& id, bool& hasPendingResource)
158 { 158 {
159 if (paintType != SVGPaint::SVG_PAINTTYPE_URI && paintType != SVGPaint::SVG_P AINTTYPE_URI_RGBCOLOR) 159 if (paintType != SVGPaint::SVG_PAINTTYPE_URI && paintType != SVGPaint::SVG_P AINTTYPE_URI_RGBCOLOR)
160 return 0; 160 return 0;
(...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after
656 if (RenderSVGResourceContainer* stroke = m_fillStrokeData->stroke) 656 if (RenderSVGResourceContainer* stroke = m_fillStrokeData->stroke)
657 fprintf(stderr, " |-> Stroke : %p (node=%p)\n", stroke, stroke-> node()); 657 fprintf(stderr, " |-> Stroke : %p (node=%p)\n", stroke, stroke-> node());
658 } 658 }
659 659
660 if (m_linkedResource) 660 if (m_linkedResource)
661 fprintf(stderr, " |-> xlink:href : %p (node=%p)\n", m_linkedResource, m_ linkedResource->node()); 661 fprintf(stderr, " |-> xlink:href : %p (node=%p)\n", m_linkedResource, m_ linkedResource->node());
662 } 662 }
663 #endif 663 #endif
664 664
665 } 665 }
OLDNEW
« no previous file with comments | « Source/core/rendering/svg/RenderSVGResourceFilter.cpp ('k') | Source/core/svg/SVGFilterElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698