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

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

Issue 23205014: Introduce toSVGLinearGradientElement(), and use it (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
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 521 matching lines...) Expand 10 before | Expand all | Expand 10 after
532 532
533 AffineTransform transform = attributes.patternTransform(); 533 AffineTransform transform = attributes.patternTransform();
534 if (!transform.isIdentity()) 534 if (!transform.isIdentity())
535 ts << " [patternTransform=" << transform << "]"; 535 ts << " [patternTransform=" << transform << "]";
536 ts << "\n"; 536 ts << "\n";
537 } else if (resource->resourceType() == LinearGradientResourceType) { 537 } else if (resource->resourceType() == LinearGradientResourceType) {
538 RenderSVGResourceLinearGradient* gradient = static_cast<RenderSVGResourc eLinearGradient*>(resource); 538 RenderSVGResourceLinearGradient* gradient = static_cast<RenderSVGResourc eLinearGradient*>(resource);
539 539
540 // Dump final results that are used for rendering. No use in asking SVGG radientElement for its gradientUnits(), as it may 540 // Dump final results that are used for rendering. No use in asking SVGG radientElement for its gradientUnits(), as it may
541 // link to other gradients using xlink:href, we need to build the full i nheritance chain, aka. collectGradientProperties() 541 // link to other gradients using xlink:href, we need to build the full i nheritance chain, aka. collectGradientProperties()
542 SVGLinearGradientElement* linearGradientElement = static_cast<SVGLinearG radientElement*>(gradient->node());
543
544 LinearGradientAttributes attributes; 542 LinearGradientAttributes attributes;
545 linearGradientElement->collectGradientAttributes(attributes); 543 toSVGLinearGradientElement(gradient->node())->collectGradientAttributes( attributes);
546 writeCommonGradientProperties(ts, attributes.spreadMethod(), attributes. gradientTransform(), attributes.gradientUnits()); 544 writeCommonGradientProperties(ts, attributes.spreadMethod(), attributes. gradientTransform(), attributes.gradientUnits());
547 545
548 ts << " [start=" << gradient->startPoint(attributes) << "] [end=" << gra dient->endPoint(attributes) << "]\n"; 546 ts << " [start=" << gradient->startPoint(attributes) << "] [end=" << gra dient->endPoint(attributes) << "]\n";
549 } else if (resource->resourceType() == RadialGradientResourceType) { 547 } else if (resource->resourceType() == RadialGradientResourceType) {
550 RenderSVGResourceRadialGradient* gradient = static_cast<RenderSVGResourc eRadialGradient*>(resource); 548 RenderSVGResourceRadialGradient* gradient = static_cast<RenderSVGResourc eRadialGradient*>(resource);
551 549
552 // Dump final results that are used for rendering. No use in asking SVGG radientElement for its gradientUnits(), as it may 550 // Dump final results that are used for rendering. No use in asking SVGG radientElement for its gradientUnits(), as it may
553 // link to other gradients using xlink:href, we need to build the full i nheritance chain, aka. collectGradientProperties() 551 // link to other gradients using xlink:href, we need to build the full i nheritance chain, aka. collectGradientProperties()
554 SVGRadialGradientElement* radialGradientElement = static_cast<SVGRadialG radientElement*>(gradient->node()); 552 SVGRadialGradientElement* radialGradientElement = static_cast<SVGRadialG radientElement*>(gradient->node());
555 553
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
667 ts << " "; 665 ts << " ";
668 writeNameAndQuotedValue(ts, "filter", svgStyle->filterResource()); 666 writeNameAndQuotedValue(ts, "filter", svgStyle->filterResource());
669 ts << " "; 667 ts << " ";
670 writeStandardPrefix(ts, *filter, 0); 668 writeStandardPrefix(ts, *filter, 0);
671 ts << " " << filter->resourceBoundingBox(&renderer) << "\n"; 669 ts << " " << filter->resourceBoundingBox(&renderer) << "\n";
672 } 670 }
673 } 671 }
674 } 672 }
675 673
676 } // namespace WebCore 674 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/rendering/svg/RenderSVGResourceLinearGradient.cpp ('k') | Source/core/svg/SVGLinearGradientElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698