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 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 | 282 |
283 SVGPaintDescription strokePaintDescription = RenderSVGResourcePaintServe
r::requestPaintDescription(shape, shape.style(), ApplyToStrokeMode); | 283 SVGPaintDescription strokePaintDescription = RenderSVGResourcePaintServe
r::requestPaintDescription(shape, shape.style(), ApplyToStrokeMode); |
284 if (strokePaintDescription.isValid) { | 284 if (strokePaintDescription.isValid) { |
285 TextStreamSeparator s(" "); | 285 TextStreamSeparator s(" "); |
286 ts << " [stroke={" << s; | 286 ts << " [stroke={" << s; |
287 writeSVGPaintingResource(ts, strokePaintDescription); | 287 writeSVGPaintingResource(ts, strokePaintDescription); |
288 | 288 |
289 SVGLengthContext lengthContext(shape.element()); | 289 SVGLengthContext lengthContext(shape.element()); |
290 double dashOffset = svgStyle.strokeDashOffset()->value(lengthContext
); | 290 double dashOffset = svgStyle.strokeDashOffset()->value(lengthContext
); |
291 double strokeWidth = svgStyle.strokeWidth()->value(lengthContext); | 291 double strokeWidth = svgStyle.strokeWidth()->value(lengthContext); |
292 RefPtr<SVGLengthList> dashes = svgStyle.strokeDashArray(); | 292 RefPtrWillBeRawPtr<SVGLengthList> dashes = svgStyle.strokeDashArray(
); |
293 | 293 |
294 DashArray dashArray; | 294 DashArray dashArray; |
295 SVGLengthList::ConstIterator it = dashes->begin(); | 295 SVGLengthList::ConstIterator it = dashes->begin(); |
296 SVGLengthList::ConstIterator itEnd = dashes->end(); | 296 SVGLengthList::ConstIterator itEnd = dashes->end(); |
297 for (; it != itEnd; ++it) | 297 for (; it != itEnd; ++it) |
298 dashArray.append(it->value(lengthContext)); | 298 dashArray.append(it->value(lengthContext)); |
299 | 299 |
300 writeIfNotDefault(ts, "opacity", svgStyle.strokeOpacity(), 1.0f); | 300 writeIfNotDefault(ts, "opacity", svgStyle.strokeOpacity(), 1.0f); |
301 writeIfNotDefault(ts, "stroke width", strokeWidth, 1.0); | 301 writeIfNotDefault(ts, "stroke width", strokeWidth, 1.0); |
302 writeIfNotDefault(ts, "miter limit", svgStyle.strokeMiterLimit(), 4.
0f); | 302 writeIfNotDefault(ts, "miter limit", svgStyle.strokeMiterLimit(), 4.
0f); |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
506 writeNameValuePair(ts, "maskContentUnits", masker->maskContentUnits()); | 506 writeNameValuePair(ts, "maskContentUnits", masker->maskContentUnits()); |
507 ts << "\n"; | 507 ts << "\n"; |
508 } else if (resource->resourceType() == FilterResourceType) { | 508 } else if (resource->resourceType() == FilterResourceType) { |
509 RenderSVGResourceFilter* filter = toRenderSVGResourceFilter(resource); | 509 RenderSVGResourceFilter* filter = toRenderSVGResourceFilter(resource); |
510 writeNameValuePair(ts, "filterUnits", filter->filterUnits()); | 510 writeNameValuePair(ts, "filterUnits", filter->filterUnits()); |
511 writeNameValuePair(ts, "primitiveUnits", filter->primitiveUnits()); | 511 writeNameValuePair(ts, "primitiveUnits", filter->primitiveUnits()); |
512 ts << "\n"; | 512 ts << "\n"; |
513 // Creating a placeholder filter which is passed to the builder. | 513 // Creating a placeholder filter which is passed to the builder. |
514 FloatRect dummyRect; | 514 FloatRect dummyRect; |
515 IntRect dummyIntRect; | 515 IntRect dummyIntRect; |
516 RefPtr<SVGFilter> dummyFilter = SVGFilter::create(dummyIntRect, dummyRec
t, dummyRect, true); | 516 RefPtrWillBeRawPtr<SVGFilter> dummyFilter = SVGFilter::create(dummyIntRe
ct, dummyRect, dummyRect, true); |
517 if (RefPtr<SVGFilterBuilder> builder = filter->buildPrimitives(dummyFilt
er.get())) { | 517 if (RefPtrWillBeRawPtr<SVGFilterBuilder> builder = filter->buildPrimitiv
es(dummyFilter.get())) { |
518 if (FilterEffect* lastEffect = builder->lastEffect()) | 518 if (FilterEffect* lastEffect = builder->lastEffect()) |
519 lastEffect->externalRepresentation(ts, indent + 1); | 519 lastEffect->externalRepresentation(ts, indent + 1); |
520 } | 520 } |
521 } else if (resource->resourceType() == ClipperResourceType) { | 521 } else if (resource->resourceType() == ClipperResourceType) { |
522 writeNameValuePair(ts, "clipPathUnits", toRenderSVGResourceClipper(resou
rce)->clipPathUnits()); | 522 writeNameValuePair(ts, "clipPathUnits", toRenderSVGResourceClipper(resou
rce)->clipPathUnits()); |
523 ts << "\n"; | 523 ts << "\n"; |
524 } else if (resource->resourceType() == MarkerResourceType) { | 524 } else if (resource->resourceType() == MarkerResourceType) { |
525 RenderSVGResourceMarker* marker = toRenderSVGResourceMarker(resource); | 525 RenderSVGResourceMarker* marker = toRenderSVGResourceMarker(resource); |
526 writeNameValuePair(ts, "markerUnits", marker->markerUnits()); | 526 writeNameValuePair(ts, "markerUnits", marker->markerUnits()); |
527 ts << " [ref at " << marker->referencePoint() << "]"; | 527 ts << " [ref at " << marker->referencePoint() << "]"; |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
674 ts << " "; | 674 ts << " "; |
675 writeNameAndQuotedValue(ts, "filter", svgStyle.filterResource()); | 675 writeNameAndQuotedValue(ts, "filter", svgStyle.filterResource()); |
676 ts << " "; | 676 ts << " "; |
677 writeStandardPrefix(ts, *filter, 0); | 677 writeStandardPrefix(ts, *filter, 0); |
678 ts << " " << filter->resourceBoundingBox(&renderer) << "\n"; | 678 ts << " " << filter->resourceBoundingBox(&renderer) << "\n"; |
679 } | 679 } |
680 } | 680 } |
681 } | 681 } |
682 | 682 |
683 } // namespace blink | 683 } // namespace blink |
OLD | NEW |