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

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

Issue 678163002: Oilpan: move SVG property hierarchy to the heap. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased upto r185213 Created 6 years, 1 month 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007, 2008 Rob Buis <buis@kde.org> 2 * Copyright (C) 2007, 2008 Rob Buis <buis@kde.org>
3 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> 3 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org>
4 * Copyright (C) 2007 Eric Seidel <eric@webkit.org> 4 * Copyright (C) 2007 Eric Seidel <eric@webkit.org>
5 * Copyright (C) 2009 Google, Inc. All rights reserved. 5 * Copyright (C) 2009 Google, Inc. All rights reserved.
6 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> 6 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
7 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved. 7 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 ASSERT(object->node()->isSVGElement()); 345 ASSERT(object->node()->isSVGElement());
346 346
347 const SVGRenderStyle& svgStyle = style->svgStyle(); 347 const SVGRenderStyle& svgStyle = style->svgStyle();
348 348
349 SVGLengthContext lengthContext(toSVGElement(object->node())); 349 SVGLengthContext lengthContext(toSVGElement(object->node()));
350 context->setStrokeThickness(svgStyle.strokeWidth()->value(lengthContext)); 350 context->setStrokeThickness(svgStyle.strokeWidth()->value(lengthContext));
351 context->setLineCap(svgStyle.capStyle()); 351 context->setLineCap(svgStyle.capStyle());
352 context->setLineJoin(svgStyle.joinStyle()); 352 context->setLineJoin(svgStyle.joinStyle());
353 context->setMiterLimit(svgStyle.strokeMiterLimit()); 353 context->setMiterLimit(svgStyle.strokeMiterLimit());
354 354
355 RefPtr<SVGLengthList> dashes = svgStyle.strokeDashArray(); 355 RefPtrWillBeRawPtr<SVGLengthList> dashes = svgStyle.strokeDashArray();
356 if (dashes->isEmpty()) 356 if (dashes->isEmpty())
357 return; 357 return;
358 358
359 DashArray dashArray; 359 DashArray dashArray;
360 SVGLengthList::ConstIterator it = dashes->begin(); 360 SVGLengthList::ConstIterator it = dashes->begin();
361 SVGLengthList::ConstIterator itEnd = dashes->end(); 361 SVGLengthList::ConstIterator itEnd = dashes->end();
362 for (; it != itEnd; ++it) 362 for (; it != itEnd; ++it)
363 dashArray.append(it->value(lengthContext)); 363 dashArray.append(it->value(lengthContext));
364 364
365 context->setLineDash(dashArray, svgStyle.strokeDashOffset()->value(lengthCon text)); 365 context->setLineDash(dashArray, svgStyle.strokeDashOffset()->value(lengthCon text));
366 } 366 }
367 367
368 void SVGRenderSupport::applyStrokeStyleToStrokeData(StrokeData* strokeData, cons t RenderStyle* style, const RenderObject* object) 368 void SVGRenderSupport::applyStrokeStyleToStrokeData(StrokeData* strokeData, cons t RenderStyle* style, const RenderObject* object)
369 { 369 {
370 ASSERT(strokeData); 370 ASSERT(strokeData);
371 ASSERT(style); 371 ASSERT(style);
372 ASSERT(object); 372 ASSERT(object);
373 ASSERT(object->node()); 373 ASSERT(object->node());
374 ASSERT(object->node()->isSVGElement()); 374 ASSERT(object->node()->isSVGElement());
375 375
376 const SVGRenderStyle& svgStyle = style->svgStyle(); 376 const SVGRenderStyle& svgStyle = style->svgStyle();
377 377
378 SVGLengthContext lengthContext(toSVGElement(object->node())); 378 SVGLengthContext lengthContext(toSVGElement(object->node()));
379 strokeData->setThickness(svgStyle.strokeWidth()->value(lengthContext)); 379 strokeData->setThickness(svgStyle.strokeWidth()->value(lengthContext));
380 strokeData->setLineCap(svgStyle.capStyle()); 380 strokeData->setLineCap(svgStyle.capStyle());
381 strokeData->setLineJoin(svgStyle.joinStyle()); 381 strokeData->setLineJoin(svgStyle.joinStyle());
382 strokeData->setMiterLimit(svgStyle.strokeMiterLimit()); 382 strokeData->setMiterLimit(svgStyle.strokeMiterLimit());
383 383
384 RefPtr<SVGLengthList> dashes = svgStyle.strokeDashArray(); 384 RefPtrWillBeRawPtr<SVGLengthList> dashes = svgStyle.strokeDashArray();
385 if (dashes->isEmpty()) 385 if (dashes->isEmpty())
386 return; 386 return;
387 387
388 DashArray dashArray; 388 DashArray dashArray;
389 size_t length = dashes->length(); 389 size_t length = dashes->length();
390 for (size_t i = 0; i < length; ++i) 390 for (size_t i = 0; i < length; ++i)
391 dashArray.append(dashes->at(i)->value(lengthContext)); 391 dashArray.append(dashes->at(i)->value(lengthContext));
392 392
393 strokeData->setLineDash(dashArray, svgStyle.strokeDashOffset()->value(length Context)); 393 strokeData->setLineDash(dashArray, svgStyle.strokeDashOffset()->value(length Context));
394 } 394 }
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
428 } 428 }
429 429
430 bool SVGRenderSupport::isRenderableTextNode(const RenderObject* object) 430 bool SVGRenderSupport::isRenderableTextNode(const RenderObject* object)
431 { 431 {
432 ASSERT(object->isText()); 432 ASSERT(object->isText());
433 // <br> is marked as text, but is not handled by the SVG rendering code-path . 433 // <br> is marked as text, but is not handled by the SVG rendering code-path .
434 return object->isSVGInlineText() && !toRenderSVGInlineText(object)->hasEmpty Text(); 434 return object->isSVGInlineText() && !toRenderSVGInlineText(object)->hasEmpty Text();
435 } 435 }
436 436
437 } 437 }
OLDNEW
« no previous file with comments | « Source/core/rendering/svg/SVGPathData.cpp ('k') | Source/core/rendering/svg/SVGRenderTreeAsText.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698