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

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

Issue 27648002: Refine toRenderSVGResourceContainer() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 7 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
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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 #include "core/svg/SVGPathElement.h" 60 #include "core/svg/SVGPathElement.h"
61 #include "core/svg/SVGPathUtilities.h" 61 #include "core/svg/SVGPathUtilities.h"
62 #include "core/svg/SVGPatternElement.h" 62 #include "core/svg/SVGPatternElement.h"
63 #include "core/svg/SVGPointList.h" 63 #include "core/svg/SVGPointList.h"
64 #include "core/svg/SVGPolyElement.h" 64 #include "core/svg/SVGPolyElement.h"
65 #include "core/svg/SVGRadialGradientElement.h" 65 #include "core/svg/SVGRadialGradientElement.h"
66 #include "core/svg/SVGRectElement.h" 66 #include "core/svg/SVGRectElement.h"
67 #include "core/svg/SVGStopElement.h" 67 #include "core/svg/SVGStopElement.h"
68 68
69 #include <math.h> 69 #include <math.h>
70 #include <memory>
70 71
71 namespace WebCore { 72 namespace WebCore {
72 73
73 /** class + iomanip to help streaming list separators, i.e. ", " in string "a, b , c, d" 74 /** class + iomanip to help streaming list separators, i.e. ", " in string "a, b , c, d"
74 * Can be used in cases where you don't know which item in the list is the first 75 * Can be used in cases where you don't know which item in the list is the first
75 * one to be printed, but still want to avoid strings like ", b, c". 76 * one to be printed, but still want to avoid strings like ", b, c".
76 */ 77 */
77 class TextStreamSeparator { 78 class TextStreamSeparator {
78 public: 79 public:
79 TextStreamSeparator(const String& s) 80 TextStreamSeparator(const String& s)
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after
476 } 477 }
477 478
478 void writeSVGResourceContainer(TextStream& ts, const RenderObject& object, int i ndent) 479 void writeSVGResourceContainer(TextStream& ts, const RenderObject& object, int i ndent)
479 { 480 {
480 writeStandardPrefix(ts, object, indent); 481 writeStandardPrefix(ts, object, indent);
481 482
482 Element* element = toElement(object.node()); 483 Element* element = toElement(object.node());
483 const AtomicString& id = element->getIdAttribute(); 484 const AtomicString& id = element->getIdAttribute();
484 writeNameAndQuotedValue(ts, "id", id); 485 writeNameAndQuotedValue(ts, "id", id);
485 486
486 RenderSVGResourceContainer* resource = const_cast<RenderObject&>(object).toR enderSVGResourceContainer(); 487 RenderSVGResourceContainer* resource = toRenderSVGResourceContainer(const_ca st<RenderObject*>(&object));
487 ASSERT(resource); 488 ASSERT(resource);
488 489
489 if (resource->resourceType() == MaskerResourceType) { 490 if (resource->resourceType() == MaskerResourceType) {
490 RenderSVGResourceMasker* masker = toRenderSVGResourceMasker(resource); 491 RenderSVGResourceMasker* masker = toRenderSVGResourceMasker(resource);
491 writeNameValuePair(ts, "maskUnits", masker->maskUnits()); 492 writeNameValuePair(ts, "maskUnits", masker->maskUnits());
492 writeNameValuePair(ts, "maskContentUnits", masker->maskContentUnits()); 493 writeNameValuePair(ts, "maskContentUnits", masker->maskContentUnits());
493 ts << "\n"; 494 ts << "\n";
494 } else if (resource->resourceType() == FilterResourceType) { 495 } else if (resource->resourceType() == FilterResourceType) {
495 RenderSVGResourceFilter* filter = toRenderSVGResourceFilter(resource); 496 RenderSVGResourceFilter* filter = toRenderSVGResourceFilter(resource);
496 writeNameValuePair(ts, "filterUnits", filter->filterUnits()); 497 writeNameValuePair(ts, "filterUnits", filter->filterUnits());
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
659 ts << " "; 660 ts << " ";
660 writeNameAndQuotedValue(ts, "filter", svgStyle->filterResource()); 661 writeNameAndQuotedValue(ts, "filter", svgStyle->filterResource());
661 ts << " "; 662 ts << " ";
662 writeStandardPrefix(ts, *filter, 0); 663 writeStandardPrefix(ts, *filter, 0);
663 ts << " " << filter->resourceBoundingBox(&renderer) << "\n"; 664 ts << " " << filter->resourceBoundingBox(&renderer) << "\n";
664 } 665 }
665 } 666 }
666 } 667 }
667 668
668 } // namespace WebCore 669 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/rendering/svg/RenderSVGResourceContainer.cpp ('k') | Source/core/rendering/svg/SVGResourcesCycleSolver.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698