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

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

Issue 24096014: Add toRenderSVGResourceFilter() fuction, and use it. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 3 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 | « Source/core/rendering/svg/RenderSVGResourceFilterPrimitive.cpp ('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 474 matching lines...) Expand 10 before | Expand all | Expand 10 after
485 485
486 RenderSVGResourceContainer* resource = const_cast<RenderObject&>(object).toR enderSVGResourceContainer(); 486 RenderSVGResourceContainer* resource = const_cast<RenderObject&>(object).toR enderSVGResourceContainer();
487 ASSERT(resource); 487 ASSERT(resource);
488 488
489 if (resource->resourceType() == MaskerResourceType) { 489 if (resource->resourceType() == MaskerResourceType) {
490 RenderSVGResourceMasker* masker = toRenderSVGResourceMasker(resource); 490 RenderSVGResourceMasker* masker = toRenderSVGResourceMasker(resource);
491 writeNameValuePair(ts, "maskUnits", masker->maskUnits()); 491 writeNameValuePair(ts, "maskUnits", masker->maskUnits());
492 writeNameValuePair(ts, "maskContentUnits", masker->maskContentUnits()); 492 writeNameValuePair(ts, "maskContentUnits", masker->maskContentUnits());
493 ts << "\n"; 493 ts << "\n";
494 } else if (resource->resourceType() == FilterResourceType) { 494 } else if (resource->resourceType() == FilterResourceType) {
495 RenderSVGResourceFilter* filter = static_cast<RenderSVGResourceFilter*>( resource); 495 RenderSVGResourceFilter* filter = toRenderSVGResourceFilter(resource);
496 writeNameValuePair(ts, "filterUnits", filter->filterUnits()); 496 writeNameValuePair(ts, "filterUnits", filter->filterUnits());
497 writeNameValuePair(ts, "primitiveUnits", filter->primitiveUnits()); 497 writeNameValuePair(ts, "primitiveUnits", filter->primitiveUnits());
498 ts << "\n"; 498 ts << "\n";
499 // Creating a placeholder filter which is passed to the builder. 499 // Creating a placeholder filter which is passed to the builder.
500 FloatRect dummyRect; 500 FloatRect dummyRect;
501 RefPtr<SVGFilter> dummyFilter = SVGFilter::create(AffineTransform(), dum myRect, dummyRect, dummyRect, true); 501 RefPtr<SVGFilter> dummyFilter = SVGFilter::create(AffineTransform(), dum myRect, dummyRect, dummyRect, true);
502 if (RefPtr<SVGFilterBuilder> builder = filter->buildPrimitives(dummyFilt er.get())) { 502 if (RefPtr<SVGFilterBuilder> builder = filter->buildPrimitives(dummyFilt er.get())) {
503 if (FilterEffect* lastEffect = builder->lastEffect()) 503 if (FilterEffect* lastEffect = builder->lastEffect())
504 lastEffect->externalRepresentation(ts, indent + 1); 504 lastEffect->externalRepresentation(ts, indent + 1);
505 } 505 }
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
659 ts << " "; 659 ts << " ";
660 writeNameAndQuotedValue(ts, "filter", svgStyle->filterResource()); 660 writeNameAndQuotedValue(ts, "filter", svgStyle->filterResource());
661 ts << " "; 661 ts << " ";
662 writeStandardPrefix(ts, *filter, 0); 662 writeStandardPrefix(ts, *filter, 0);
663 ts << " " << filter->resourceBoundingBox(&renderer) << "\n"; 663 ts << " " << filter->resourceBoundingBox(&renderer) << "\n";
664 } 664 }
665 } 665 }
666 } 666 }
667 667
668 } // namespace WebCore 668 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/rendering/svg/RenderSVGResourceFilterPrimitive.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698