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

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

Issue 22897011: Introduce toSVGRadialGradientElement(), 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 533 matching lines...) Expand 10 before | Expand all | Expand 10 after
544 LinearGradientAttributes attributes; 544 LinearGradientAttributes attributes;
545 linearGradientElement->collectGradientAttributes(attributes); 545 linearGradientElement->collectGradientAttributes(attributes);
546 writeCommonGradientProperties(ts, attributes.spreadMethod(), attributes. gradientTransform(), attributes.gradientUnits()); 546 writeCommonGradientProperties(ts, attributes.spreadMethod(), attributes. gradientTransform(), attributes.gradientUnits());
547 547
548 ts << " [start=" << gradient->startPoint(attributes) << "] [end=" << gra dient->endPoint(attributes) << "]\n"; 548 ts << " [start=" << gradient->startPoint(attributes) << "] [end=" << gra dient->endPoint(attributes) << "]\n";
549 } else if (resource->resourceType() == RadialGradientResourceType) { 549 } else if (resource->resourceType() == RadialGradientResourceType) {
550 RenderSVGResourceRadialGradient* gradient = static_cast<RenderSVGResourc eRadialGradient*>(resource); 550 RenderSVGResourceRadialGradient* gradient = static_cast<RenderSVGResourc eRadialGradient*>(resource);
551 551
552 // Dump final results that are used for rendering. No use in asking SVGG radientElement for its gradientUnits(), as it may 552 // 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() 553 // 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());
555
556 RadialGradientAttributes attributes; 554 RadialGradientAttributes attributes;
557 radialGradientElement->collectGradientAttributes(attributes); 555 toSVGRadialGradientElement(gradient->node())->collectGradientAttributes( attributes);
558 writeCommonGradientProperties(ts, attributes.spreadMethod(), attributes. gradientTransform(), attributes.gradientUnits()); 556 writeCommonGradientProperties(ts, attributes.spreadMethod(), attributes. gradientTransform(), attributes.gradientUnits());
559 557
560 FloatPoint focalPoint = gradient->focalPoint(attributes); 558 FloatPoint focalPoint = gradient->focalPoint(attributes);
561 FloatPoint centerPoint = gradient->centerPoint(attributes); 559 FloatPoint centerPoint = gradient->centerPoint(attributes);
562 float radius = gradient->radius(attributes); 560 float radius = gradient->radius(attributes);
563 float focalRadius = gradient->focalRadius(attributes); 561 float focalRadius = gradient->focalRadius(attributes);
564 562
565 ts << " [center=" << centerPoint << "] [focal=" << focalPoint << "] [rad ius=" << radius << "] [focalRadius=" << focalRadius << "]\n"; 563 ts << " [center=" << centerPoint << "] [focal=" << focalPoint << "] [rad ius=" << radius << "] [focalRadius=" << focalRadius << "]\n";
566 } else 564 } else
567 ts << "\n"; 565 ts << "\n";
(...skipping 99 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/RenderSVGResourceRadialGradient.cpp ('k') | Source/core/svg/SVGRadialGradientElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698