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 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 | 280 |
281 if (!object.localTransform().isIdentity()) | 281 if (!object.localTransform().isIdentity()) |
282 writeNameValuePair(ts, "transform", object.localTransform()); | 282 writeNameValuePair(ts, "transform", object.localTransform()); |
283 writeIfNotDefault(ts, "image rendering", style->imageRendering(), RenderStyl
e::initialImageRendering()); | 283 writeIfNotDefault(ts, "image rendering", style->imageRendering(), RenderStyl
e::initialImageRendering()); |
284 writeIfNotDefault(ts, "opacity", style->opacity(), RenderStyle::initialOpaci
ty()); | 284 writeIfNotDefault(ts, "opacity", style->opacity(), RenderStyle::initialOpaci
ty()); |
285 if (object.isSVGShape()) { | 285 if (object.isSVGShape()) { |
286 const RenderSVGShape& shape = static_cast<const RenderSVGShape&>(object)
; | 286 const RenderSVGShape& shape = static_cast<const RenderSVGShape&>(object)
; |
287 ASSERT(shape.element()); | 287 ASSERT(shape.element()); |
288 | 288 |
289 bool hasFallback; | 289 bool hasFallback; |
290 if (RenderSVGResource* strokePaintingResource = RenderSVGResource::strok
ePaintingResource(const_cast<RenderSVGShape*>(&shape), shape.style(), hasFallbac
k)) { | 290 if (RenderSVGResource* strokePaintingResource = RenderSVGResource::reque
stPaintingResource(ApplyToStrokeMode, const_cast<RenderSVGShape*>(&shape), shape
.style(), hasFallback)) { |
291 TextStreamSeparator s(" "); | 291 TextStreamSeparator s(" "); |
292 ts << " [stroke={" << s; | 292 ts << " [stroke={" << s; |
293 writeSVGPaintingResource(ts, strokePaintingResource); | 293 writeSVGPaintingResource(ts, strokePaintingResource); |
294 | 294 |
295 SVGLengthContext lengthContext(shape.element()); | 295 SVGLengthContext lengthContext(shape.element()); |
296 double dashOffset = svgStyle.strokeDashOffset()->value(lengthContext
); | 296 double dashOffset = svgStyle.strokeDashOffset()->value(lengthContext
); |
297 double strokeWidth = svgStyle.strokeWidth()->value(lengthContext); | 297 double strokeWidth = svgStyle.strokeWidth()->value(lengthContext); |
298 RefPtr<SVGLengthList> dashes = svgStyle.strokeDashArray(); | 298 RefPtr<SVGLengthList> dashes = svgStyle.strokeDashArray(); |
299 | 299 |
300 DashArray dashArray; | 300 DashArray dashArray; |
301 SVGLengthList::ConstIterator it = dashes->begin(); | 301 SVGLengthList::ConstIterator it = dashes->begin(); |
302 SVGLengthList::ConstIterator itEnd = dashes->end(); | 302 SVGLengthList::ConstIterator itEnd = dashes->end(); |
303 for (; it != itEnd; ++it) | 303 for (; it != itEnd; ++it) |
304 dashArray.append(it->value(lengthContext)); | 304 dashArray.append(it->value(lengthContext)); |
305 | 305 |
306 writeIfNotDefault(ts, "opacity", svgStyle.strokeOpacity(), 1.0f); | 306 writeIfNotDefault(ts, "opacity", svgStyle.strokeOpacity(), 1.0f); |
307 writeIfNotDefault(ts, "stroke width", strokeWidth, 1.0); | 307 writeIfNotDefault(ts, "stroke width", strokeWidth, 1.0); |
308 writeIfNotDefault(ts, "miter limit", svgStyle.strokeMiterLimit(), 4.
0f); | 308 writeIfNotDefault(ts, "miter limit", svgStyle.strokeMiterLimit(), 4.
0f); |
309 writeIfNotDefault(ts, "line cap", svgStyle.capStyle(), ButtCap); | 309 writeIfNotDefault(ts, "line cap", svgStyle.capStyle(), ButtCap); |
310 writeIfNotDefault(ts, "line join", svgStyle.joinStyle(), MiterJoin); | 310 writeIfNotDefault(ts, "line join", svgStyle.joinStyle(), MiterJoin); |
311 writeIfNotDefault(ts, "dash offset", dashOffset, 0.0); | 311 writeIfNotDefault(ts, "dash offset", dashOffset, 0.0); |
312 if (!dashArray.isEmpty()) | 312 if (!dashArray.isEmpty()) |
313 writeNameValuePair(ts, "dash array", dashArray); | 313 writeNameValuePair(ts, "dash array", dashArray); |
314 | 314 |
315 ts << "}]"; | 315 ts << "}]"; |
316 } | 316 } |
317 | 317 |
318 if (RenderSVGResource* fillPaintingResource = RenderSVGResource::fillPai
ntingResource(const_cast<RenderSVGShape*>(&shape), shape.style(), hasFallback))
{ | 318 if (RenderSVGResource* fillPaintingResource = RenderSVGResource::request
PaintingResource(ApplyToFillMode, const_cast<RenderSVGShape*>(&shape), shape.sty
le(), hasFallback)) { |
319 TextStreamSeparator s(" "); | 319 TextStreamSeparator s(" "); |
320 ts << " [fill={" << s; | 320 ts << " [fill={" << s; |
321 writeSVGPaintingResource(ts, fillPaintingResource); | 321 writeSVGPaintingResource(ts, fillPaintingResource); |
322 | 322 |
323 writeIfNotDefault(ts, "opacity", svgStyle.fillOpacity(), 1.0f); | 323 writeIfNotDefault(ts, "opacity", svgStyle.fillOpacity(), 1.0f); |
324 writeIfNotDefault(ts, "fill rule", svgStyle.fillRule(), RULE_NONZERO
); | 324 writeIfNotDefault(ts, "fill rule", svgStyle.fillRule(), RULE_NONZERO
); |
325 ts << "}]"; | 325 ts << "}]"; |
326 } | 326 } |
327 writeIfNotDefault(ts, "clip rule", svgStyle.clipRule(), RULE_NONZERO); | 327 writeIfNotDefault(ts, "clip rule", svgStyle.clipRule(), RULE_NONZERO); |
328 } | 328 } |
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
679 ts << " "; | 679 ts << " "; |
680 writeNameAndQuotedValue(ts, "filter", svgStyle.filterResource()); | 680 writeNameAndQuotedValue(ts, "filter", svgStyle.filterResource()); |
681 ts << " "; | 681 ts << " "; |
682 writeStandardPrefix(ts, *filter, 0); | 682 writeStandardPrefix(ts, *filter, 0); |
683 ts << " " << filter->resourceBoundingBox(&renderer) << "\n"; | 683 ts << " " << filter->resourceBoundingBox(&renderer) << "\n"; |
684 } | 684 } |
685 } | 685 } |
686 } | 686 } |
687 | 687 |
688 } // namespace blink | 688 } // namespace blink |
OLD | NEW |