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

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

Issue 661643005: Pass more const RenderObject& in the vicinity of paint-servers (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: const RenderObject& Created 6 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/rendering/svg/RenderSVGShape.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 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 275
276 if (!object.localTransform().isIdentity()) 276 if (!object.localTransform().isIdentity())
277 writeNameValuePair(ts, "transform", object.localTransform()); 277 writeNameValuePair(ts, "transform", object.localTransform());
278 writeIfNotDefault(ts, "image rendering", style->imageRendering(), RenderStyl e::initialImageRendering()); 278 writeIfNotDefault(ts, "image rendering", style->imageRendering(), RenderStyl e::initialImageRendering());
279 writeIfNotDefault(ts, "opacity", style->opacity(), RenderStyle::initialOpaci ty()); 279 writeIfNotDefault(ts, "opacity", style->opacity(), RenderStyle::initialOpaci ty());
280 if (object.isSVGShape()) { 280 if (object.isSVGShape()) {
281 const RenderSVGShape& shape = static_cast<const RenderSVGShape&>(object) ; 281 const RenderSVGShape& shape = static_cast<const RenderSVGShape&>(object) ;
282 ASSERT(shape.element()); 282 ASSERT(shape.element());
283 283
284 bool hasFallback; 284 bool hasFallback;
285 if (RenderSVGResource* strokePaintingResource = RenderSVGResource::reque stPaintingResource(ApplyToStrokeMode, const_cast<RenderSVGShape*>(&shape), shape .style(), hasFallback)) { 285 if (RenderSVGResource* strokePaintingResource = RenderSVGResource::reque stPaintingResource(ApplyToStrokeMode, shape, shape.style(), hasFallback)) {
286 TextStreamSeparator s(" "); 286 TextStreamSeparator s(" ");
287 ts << " [stroke={" << s; 287 ts << " [stroke={" << s;
288 writeSVGPaintingResource(ts, strokePaintingResource); 288 writeSVGPaintingResource(ts, strokePaintingResource);
289 289
290 SVGLengthContext lengthContext(shape.element()); 290 SVGLengthContext lengthContext(shape.element());
291 double dashOffset = svgStyle.strokeDashOffset()->value(lengthContext ); 291 double dashOffset = svgStyle.strokeDashOffset()->value(lengthContext );
292 double strokeWidth = svgStyle.strokeWidth()->value(lengthContext); 292 double strokeWidth = svgStyle.strokeWidth()->value(lengthContext);
293 RefPtr<SVGLengthList> dashes = svgStyle.strokeDashArray(); 293 RefPtr<SVGLengthList> dashes = svgStyle.strokeDashArray();
294 294
295 DashArray dashArray; 295 DashArray dashArray;
296 SVGLengthList::ConstIterator it = dashes->begin(); 296 SVGLengthList::ConstIterator it = dashes->begin();
297 SVGLengthList::ConstIterator itEnd = dashes->end(); 297 SVGLengthList::ConstIterator itEnd = dashes->end();
298 for (; it != itEnd; ++it) 298 for (; it != itEnd; ++it)
299 dashArray.append(it->value(lengthContext)); 299 dashArray.append(it->value(lengthContext));
300 300
301 writeIfNotDefault(ts, "opacity", svgStyle.strokeOpacity(), 1.0f); 301 writeIfNotDefault(ts, "opacity", svgStyle.strokeOpacity(), 1.0f);
302 writeIfNotDefault(ts, "stroke width", strokeWidth, 1.0); 302 writeIfNotDefault(ts, "stroke width", strokeWidth, 1.0);
303 writeIfNotDefault(ts, "miter limit", svgStyle.strokeMiterLimit(), 4. 0f); 303 writeIfNotDefault(ts, "miter limit", svgStyle.strokeMiterLimit(), 4. 0f);
304 writeIfNotDefault(ts, "line cap", svgStyle.capStyle(), ButtCap); 304 writeIfNotDefault(ts, "line cap", svgStyle.capStyle(), ButtCap);
305 writeIfNotDefault(ts, "line join", svgStyle.joinStyle(), MiterJoin); 305 writeIfNotDefault(ts, "line join", svgStyle.joinStyle(), MiterJoin);
306 writeIfNotDefault(ts, "dash offset", dashOffset, 0.0); 306 writeIfNotDefault(ts, "dash offset", dashOffset, 0.0);
307 if (!dashArray.isEmpty()) 307 if (!dashArray.isEmpty())
308 writeNameValuePair(ts, "dash array", dashArray); 308 writeNameValuePair(ts, "dash array", dashArray);
309 309
310 ts << "}]"; 310 ts << "}]";
311 } 311 }
312 312
313 if (RenderSVGResource* fillPaintingResource = RenderSVGResource::request PaintingResource(ApplyToFillMode, const_cast<RenderSVGShape*>(&shape), shape.sty le(), hasFallback)) { 313 if (RenderSVGResource* fillPaintingResource = RenderSVGResource::request PaintingResource(ApplyToFillMode, shape, shape.style(), hasFallback)) {
314 TextStreamSeparator s(" "); 314 TextStreamSeparator s(" ");
315 ts << " [fill={" << s; 315 ts << " [fill={" << s;
316 writeSVGPaintingResource(ts, fillPaintingResource); 316 writeSVGPaintingResource(ts, fillPaintingResource);
317 317
318 writeIfNotDefault(ts, "opacity", svgStyle.fillOpacity(), 1.0f); 318 writeIfNotDefault(ts, "opacity", svgStyle.fillOpacity(), 1.0f);
319 writeIfNotDefault(ts, "fill rule", svgStyle.fillRule(), RULE_NONZERO ); 319 writeIfNotDefault(ts, "fill rule", svgStyle.fillRule(), RULE_NONZERO );
320 ts << "}]"; 320 ts << "}]";
321 } 321 }
322 writeIfNotDefault(ts, "clip rule", svgStyle.clipRule(), RULE_NONZERO); 322 writeIfNotDefault(ts, "clip rule", svgStyle.clipRule(), RULE_NONZERO);
323 } 323 }
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW
« no previous file with comments | « Source/core/rendering/svg/RenderSVGShape.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698