OLD | NEW |
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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 #include "core/svg/SVGLineElement.h" | 56 #include "core/svg/SVGLineElement.h" |
57 #include "core/svg/SVGLinearGradientElement.h" | 57 #include "core/svg/SVGLinearGradientElement.h" |
58 #include "core/svg/SVGPathElement.h" | 58 #include "core/svg/SVGPathElement.h" |
59 #include "core/svg/SVGPathUtilities.h" | 59 #include "core/svg/SVGPathUtilities.h" |
60 #include "core/svg/SVGPatternElement.h" | 60 #include "core/svg/SVGPatternElement.h" |
61 #include "core/svg/SVGPointList.h" | 61 #include "core/svg/SVGPointList.h" |
62 #include "core/svg/SVGPolyElement.h" | 62 #include "core/svg/SVGPolyElement.h" |
63 #include "core/svg/SVGRadialGradientElement.h" | 63 #include "core/svg/SVGRadialGradientElement.h" |
64 #include "core/svg/SVGRectElement.h" | 64 #include "core/svg/SVGRectElement.h" |
65 #include "core/svg/SVGStopElement.h" | 65 #include "core/svg/SVGStopElement.h" |
| 66 #include "core/svg/graphics/filters/SVGFilterBuilder.h" |
66 #include "platform/graphics/DashArray.h" | 67 #include "platform/graphics/DashArray.h" |
67 #include "platform/graphics/GraphicsTypes.h" | 68 #include "platform/graphics/GraphicsTypes.h" |
| 69 #include "platform/graphics/filters/SourceGraphic.h" |
68 | 70 |
69 #include <math.h> | 71 #include <math.h> |
70 #include <memory> | 72 #include <memory> |
71 | 73 |
72 namespace blink { | 74 namespace blink { |
73 | 75 |
74 /** class + iomanip to help streaming list separators, i.e. ", " in string "a, b
, c, d" | 76 /** class + iomanip to help streaming list separators, i.e. ", " in string "a, b
, c, d" |
75 * Can be used in cases where you don't know which item in the list is the first | 77 * Can be used in cases where you don't know which item in the list is the first |
76 * one to be printed, but still want to avoid strings like ", b, c". | 78 * one to be printed, but still want to avoid strings like ", b, c". |
77 */ | 79 */ |
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
504 writeNameValuePair(ts, "maskContentUnits", masker->maskContentUnits()); | 506 writeNameValuePair(ts, "maskContentUnits", masker->maskContentUnits()); |
505 ts << "\n"; | 507 ts << "\n"; |
506 } else if (resource->resourceType() == FilterResourceType) { | 508 } else if (resource->resourceType() == FilterResourceType) { |
507 LayoutSVGResourceFilter* filter = toLayoutSVGResourceFilter(resource); | 509 LayoutSVGResourceFilter* filter = toLayoutSVGResourceFilter(resource); |
508 writeNameValuePair(ts, "filterUnits", filter->filterUnits()); | 510 writeNameValuePair(ts, "filterUnits", filter->filterUnits()); |
509 writeNameValuePair(ts, "primitiveUnits", filter->primitiveUnits()); | 511 writeNameValuePair(ts, "primitiveUnits", filter->primitiveUnits()); |
510 ts << "\n"; | 512 ts << "\n"; |
511 // Creating a placeholder filter which is passed to the builder. | 513 // Creating a placeholder filter which is passed to the builder. |
512 FloatRect dummyRect; | 514 FloatRect dummyRect; |
513 RefPtrWillBeRawPtr<Filter> dummyFilter = Filter::create(dummyRect, dummy
Rect, 1, Filter::BoundingBox); | 515 RefPtrWillBeRawPtr<Filter> dummyFilter = Filter::create(dummyRect, dummy
Rect, 1, Filter::BoundingBox); |
514 if (RefPtrWillBeRawPtr<SVGFilterBuilder> builder = filter->buildPrimitiv
es(dummyFilter.get())) { | 516 SVGFilterBuilder builder(dummyFilter->sourceGraphic()); |
515 if (FilterEffect* lastEffect = builder->lastEffect()) | 517 builder.buildGraph(dummyFilter.get(), toSVGFilterElement(*filter->elemen
t()), dummyRect); |
516 lastEffect->externalRepresentation(ts, indent + 1); | 518 if (FilterEffect* lastEffect = builder.lastEffect()) |
517 } | 519 lastEffect->externalRepresentation(ts, indent + 1); |
518 } else if (resource->resourceType() == ClipperResourceType) { | 520 } else if (resource->resourceType() == ClipperResourceType) { |
519 writeNameValuePair(ts, "clipPathUnits", toLayoutSVGResourceClipper(resou
rce)->clipPathUnits()); | 521 writeNameValuePair(ts, "clipPathUnits", toLayoutSVGResourceClipper(resou
rce)->clipPathUnits()); |
520 ts << "\n"; | 522 ts << "\n"; |
521 } else if (resource->resourceType() == MarkerResourceType) { | 523 } else if (resource->resourceType() == MarkerResourceType) { |
522 LayoutSVGResourceMarker* marker = toLayoutSVGResourceMarker(resource); | 524 LayoutSVGResourceMarker* marker = toLayoutSVGResourceMarker(resource); |
523 writeNameValuePair(ts, "markerUnits", marker->markerUnits()); | 525 writeNameValuePair(ts, "markerUnits", marker->markerUnits()); |
524 ts << " [ref at " << marker->referencePoint() << "]"; | 526 ts << " [ref at " << marker->referencePoint() << "]"; |
525 ts << " [angle="; | 527 ts << " [angle="; |
526 if (marker->angle() == -1) | 528 if (marker->angle() == -1) |
527 ts << marker->orientType() << "]\n"; | 529 ts << marker->orientType() << "]\n"; |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
669 ts << " "; | 671 ts << " "; |
670 writeNameAndQuotedValue(ts, "filter", svgStyle.filterResource()); | 672 writeNameAndQuotedValue(ts, "filter", svgStyle.filterResource()); |
671 ts << " "; | 673 ts << " "; |
672 writeStandardPrefix(ts, *filter, 0); | 674 writeStandardPrefix(ts, *filter, 0); |
673 ts << " " << filter->resourceBoundingBox(&layoutObject) << "\n"; | 675 ts << " " << filter->resourceBoundingBox(&layoutObject) << "\n"; |
674 } | 676 } |
675 } | 677 } |
676 } | 678 } |
677 | 679 |
678 } // namespace blink | 680 } // namespace blink |
OLD | NEW |