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

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

Issue 22791004: Add toSVGStopElement(Node* node) to clean-up a static_cast<SVGStopElement*> (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 4 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
« no previous file with comments | « no previous file | Source/core/svg/SVGStopElement.h » ('j') | 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 607 matching lines...) Expand 10 before | Expand all | Expand 10 after
618 { 618 {
619 writeStandardPrefix(ts, shape, indent); 619 writeStandardPrefix(ts, shape, indent);
620 ts << shape << "\n"; 620 ts << shape << "\n";
621 writeResources(ts, shape, indent); 621 writeResources(ts, shape, indent);
622 } 622 }
623 623
624 void writeSVGGradientStop(TextStream& ts, const RenderSVGGradientStop& stop, int indent) 624 void writeSVGGradientStop(TextStream& ts, const RenderSVGGradientStop& stop, int indent)
625 { 625 {
626 writeStandardPrefix(ts, stop, indent); 626 writeStandardPrefix(ts, stop, indent);
627 627
628 SVGStopElement* stopElement = static_cast<SVGStopElement*>(stop.node()); 628 SVGStopElement* stopElement = toSVGStopElement(stop.node());
629 ASSERT(stopElement); 629 ASSERT(stopElement);
630 630
631 RenderStyle* style = stop.style(); 631 RenderStyle* style = stop.style();
632 if (!style) 632 if (!style)
633 return; 633 return;
634 634
635 ts << " [offset=" << stopElement->offsetCurrentValue() << "] [color=" << sto pElement->stopColorIncludingOpacity() << "]\n"; 635 ts << " [offset=" << stopElement->offsetCurrentValue() << "] [color=" << sto pElement->stopColorIncludingOpacity() << "]\n";
636 } 636 }
637 637
638 void writeResources(TextStream& ts, const RenderObject& object, int indent) 638 void writeResources(TextStream& ts, const RenderObject& object, int indent)
(...skipping 30 matching lines...) Expand all
669 ts << " "; 669 ts << " ";
670 writeNameAndQuotedValue(ts, "filter", svgStyle->filterResource()); 670 writeNameAndQuotedValue(ts, "filter", svgStyle->filterResource());
671 ts << " "; 671 ts << " ";
672 writeStandardPrefix(ts, *filter, 0); 672 writeStandardPrefix(ts, *filter, 0);
673 ts << " " << filter->resourceBoundingBox(&renderer) << "\n"; 673 ts << " " << filter->resourceBoundingBox(&renderer) << "\n";
674 } 674 }
675 } 675 }
676 } 676 }
677 677
678 } // namespace WebCore 678 } // namespace WebCore
OLDNEW
« no previous file with comments | « no previous file | Source/core/svg/SVGStopElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698