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

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

Issue 361543002: Remove SVGPaint (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Patch for landing Created 6 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 10 matching lines...) Expand all
21 #include "core/rendering/svg/SVGResources.h" 21 #include "core/rendering/svg/SVGResources.h"
22 22
23 #include "core/SVGNames.h" 23 #include "core/SVGNames.h"
24 #include "core/rendering/style/SVGRenderStyle.h" 24 #include "core/rendering/style/SVGRenderStyle.h"
25 #include "core/rendering/svg/RenderSVGResourceClipper.h" 25 #include "core/rendering/svg/RenderSVGResourceClipper.h"
26 #include "core/rendering/svg/RenderSVGResourceFilter.h" 26 #include "core/rendering/svg/RenderSVGResourceFilter.h"
27 #include "core/rendering/svg/RenderSVGResourceMarker.h" 27 #include "core/rendering/svg/RenderSVGResourceMarker.h"
28 #include "core/rendering/svg/RenderSVGResourceMasker.h" 28 #include "core/rendering/svg/RenderSVGResourceMasker.h"
29 #include "core/svg/SVGFilterElement.h" 29 #include "core/svg/SVGFilterElement.h"
30 #include "core/svg/SVGGradientElement.h" 30 #include "core/svg/SVGGradientElement.h"
31 #include "core/svg/SVGPaint.h"
32 #include "core/svg/SVGPatternElement.h" 31 #include "core/svg/SVGPatternElement.h"
33 #include "core/svg/SVGURIReference.h" 32 #include "core/svg/SVGURIReference.h"
34 33
35 #ifndef NDEBUG 34 #ifndef NDEBUG
36 #include <stdio.h> 35 #include <stdio.h>
37 #endif 36 #endif
38 37
39 namespace WebCore { 38 namespace WebCore {
40 39
41 using namespace SVGNames; 40 using namespace SVGNames;
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 else if (isSVGGradientElement(element)) 154 else if (isSVGGradientElement(element))
156 target = toSVGGradientElement(element).href()->currentValue()->value(); 155 target = toSVGGradientElement(element).href()->currentValue()->value();
157 else if (isSVGFilterElement(element)) 156 else if (isSVGFilterElement(element))
158 target = toSVGFilterElement(element).href()->currentValue()->value(); 157 target = toSVGFilterElement(element).href()->currentValue()->value();
159 else 158 else
160 ASSERT_NOT_REACHED(); 159 ASSERT_NOT_REACHED();
161 160
162 return SVGURIReference::fragmentIdentifierFromIRIString(target, element.tree Scope()); 161 return SVGURIReference::fragmentIdentifierFromIRIString(target, element.tree Scope());
163 } 162 }
164 163
165 static inline bool svgPaintTypeHasURL(SVGPaint::SVGPaintType paintType) 164 static inline bool svgPaintTypeHasURL(SVGPaintType paintType)
166 { 165 {
167 switch (paintType) { 166 switch (paintType) {
168 case SVGPaint::SVG_PAINTTYPE_URI_NONE: 167 case SVG_PAINTTYPE_URI_NONE:
169 case SVGPaint::SVG_PAINTTYPE_URI_CURRENTCOLOR: 168 case SVG_PAINTTYPE_URI_CURRENTCOLOR:
170 case SVGPaint::SVG_PAINTTYPE_URI_RGBCOLOR: 169 case SVG_PAINTTYPE_URI_RGBCOLOR:
171 case SVGPaint::SVG_PAINTTYPE_URI_RGBCOLOR_ICCCOLOR: 170 case SVG_PAINTTYPE_URI_RGBCOLOR_ICCCOLOR:
172 case SVGPaint::SVG_PAINTTYPE_URI: 171 case SVG_PAINTTYPE_URI:
173 return true; 172 return true;
174 default: 173 default:
175 break; 174 break;
176 } 175 }
177 return false; 176 return false;
178 } 177 }
179 178
180 static inline RenderSVGResourceContainer* paintingResourceFromSVGPaint(TreeScope & treeScope, const SVGPaint::SVGPaintType& paintType, const String& paintUri, At omicString& id, bool& hasPendingResource) 179 static inline RenderSVGResourceContainer* paintingResourceFromSVGPaint(TreeScope & treeScope, const SVGPaintType& paintType, const String& paintUri, AtomicString & id, bool& hasPendingResource)
181 { 180 {
182 if (!svgPaintTypeHasURL(paintType)) 181 if (!svgPaintTypeHasURL(paintType))
183 return 0; 182 return 0;
184 183
185 id = SVGURIReference::fragmentIdentifierFromIRIString(paintUri, treeScope); 184 id = SVGURIReference::fragmentIdentifierFromIRIString(paintUri, treeScope);
186 RenderSVGResourceContainer* container = getRenderSVGResourceContainerById(tr eeScope, id); 185 RenderSVGResourceContainer* container = getRenderSVGResourceContainerById(tr eeScope, id);
187 if (!container) { 186 if (!container) {
188 hasPendingResource = true; 187 hasPendingResource = true;
189 return 0; 188 return 0;
190 } 189 }
(...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after
709 if (RenderSVGResourceContainer* stroke = m_fillStrokeData->stroke) 708 if (RenderSVGResourceContainer* stroke = m_fillStrokeData->stroke)
710 fprintf(stderr, " |-> Stroke : %p (node=%p)\n", stroke, stroke-> element()); 709 fprintf(stderr, " |-> Stroke : %p (node=%p)\n", stroke, stroke-> element());
711 } 710 }
712 711
713 if (m_linkedResource) 712 if (m_linkedResource)
714 fprintf(stderr, " |-> xlink:href : %p (node=%p)\n", m_linkedResource, m_ linkedResource->element()); 713 fprintf(stderr, " |-> xlink:href : %p (node=%p)\n", m_linkedResource, m_ linkedResource->element());
715 } 714 }
716 #endif 715 #endif
717 716
718 } 717 }
OLDNEW
« no previous file with comments | « Source/core/rendering/svg/RenderSVGResource.cpp ('k') | Source/core/svg/SVGAnimatedTypeAnimator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698