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

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

Issue 672613002: Move resourceType() method to RenderSVGResourceContainer (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/rendering/svg/RenderSVGResourceContainer.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2005, 2007, 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2005, 2007, 2009 Apple Inc. All rights reserved.
3 * (C) 2005 Rob Buis <buis@kde.org> 3 * (C) 2005 Rob Buis <buis@kde.org>
4 * (C) 2006 Alexander Kellett <lypanov@kde.org> 4 * (C) 2006 Alexander Kellett <lypanov@kde.org>
5 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 5 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 ts << "[type=SOLID] [color=" << paintDescription.color << "]"; 252 ts << "[type=SOLID] [color=" << paintDescription.color << "]";
253 return; 253 return;
254 } 254 }
255 255
256 RenderSVGResource* resource = paintDescription.resource; 256 RenderSVGResource* resource = paintDescription.resource;
257 // All other resources derive from RenderSVGResourceContainer 257 // All other resources derive from RenderSVGResourceContainer
258 RenderSVGResourceContainer* container = static_cast<RenderSVGResourceContain er*>(resource); 258 RenderSVGResourceContainer* container = static_cast<RenderSVGResourceContain er*>(resource);
259 SVGElement* element = container->element(); 259 SVGElement* element = container->element();
260 ASSERT(element); 260 ASSERT(element);
261 261
262 if (resource->resourceType() == PatternResourceType) 262 if (container->resourceType() == PatternResourceType)
263 ts << "[type=PATTERN]"; 263 ts << "[type=PATTERN]";
264 else if (resource->resourceType() == LinearGradientResourceType) 264 else if (container->resourceType() == LinearGradientResourceType)
265 ts << "[type=LINEAR-GRADIENT]"; 265 ts << "[type=LINEAR-GRADIENT]";
266 else if (resource->resourceType() == RadialGradientResourceType) 266 else if (container->resourceType() == RadialGradientResourceType)
267 ts << "[type=RADIAL-GRADIENT]"; 267 ts << "[type=RADIAL-GRADIENT]";
268 268
269 ts << " [id=\"" << element->getIdAttribute() << "\"]"; 269 ts << " [id=\"" << element->getIdAttribute() << "\"]";
270 } 270 }
271 271
272 static void writeStyle(TextStream& ts, const RenderObject& object) 272 static void writeStyle(TextStream& ts, const RenderObject& object)
273 { 273 {
274 const RenderStyle* style = object.style(); 274 const RenderStyle* style = object.style();
275 const SVGRenderStyle& svgStyle = style->svgStyle(); 275 const SVGRenderStyle& svgStyle = style->svgStyle();
276 276
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after
676 ts << " "; 676 ts << " ";
677 writeNameAndQuotedValue(ts, "filter", svgStyle.filterResource()); 677 writeNameAndQuotedValue(ts, "filter", svgStyle.filterResource());
678 ts << " "; 678 ts << " ";
679 writeStandardPrefix(ts, *filter, 0); 679 writeStandardPrefix(ts, *filter, 0);
680 ts << " " << filter->resourceBoundingBox(&renderer) << "\n"; 680 ts << " " << filter->resourceBoundingBox(&renderer) << "\n";
681 } 681 }
682 } 682 }
683 } 683 }
684 684
685 } // namespace blink 685 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/rendering/svg/RenderSVGResourceContainer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698