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

Side by Side Diff: Source/core/svg/SVGSVGElement.cpp

Issue 153883003: [SVG] SVGAnimatedTransform{,List} migration to new SVG property impl. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: remove m_zoomAndPan Created 6 years, 10 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/svg/SVGSVGElement.h ('k') | Source/core/svg/SVGTextElement.cpp » ('j') | 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, 2006 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2004, 2005, 2006 Nikolas Zimmermann <zimmermann@kde.org>
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010 Rob Buis <buis@kde.org> 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010 Rob Buis <buis@kde.org>
4 * Copyright (C) 2007 Apple Inc. All rights reserved. 4 * Copyright (C) 2007 Apple Inc. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 #include "core/rendering/svg/RenderSVGResource.h" 44 #include "core/rendering/svg/RenderSVGResource.h"
45 #include "core/rendering/svg/RenderSVGRoot.h" 45 #include "core/rendering/svg/RenderSVGRoot.h"
46 #include "core/rendering/svg/RenderSVGViewportContainer.h" 46 #include "core/rendering/svg/RenderSVGViewportContainer.h"
47 #include "core/svg/SVGAngleTearOff.h" 47 #include "core/svg/SVGAngleTearOff.h"
48 #include "core/svg/SVGElementInstance.h" 48 #include "core/svg/SVGElementInstance.h"
49 #include "core/svg/SVGNumberTearOff.h" 49 #include "core/svg/SVGNumberTearOff.h"
50 #include "core/svg/SVGPreserveAspectRatio.h" 50 #include "core/svg/SVGPreserveAspectRatio.h"
51 #include "core/svg/SVGRectTearOff.h" 51 #include "core/svg/SVGRectTearOff.h"
52 #include "core/svg/SVGTransform.h" 52 #include "core/svg/SVGTransform.h"
53 #include "core/svg/SVGTransformList.h" 53 #include "core/svg/SVGTransformList.h"
54 #include "core/svg/SVGTransformTearOff.h"
54 #include "core/svg/SVGViewElement.h" 55 #include "core/svg/SVGViewElement.h"
55 #include "core/svg/SVGViewSpec.h" 56 #include "core/svg/SVGViewSpec.h"
56 #include "core/svg/animation/SMILTimeContainer.h" 57 #include "core/svg/animation/SMILTimeContainer.h"
57 #include "platform/FloatConversion.h" 58 #include "platform/FloatConversion.h"
58 #include "platform/LengthFunctions.h" 59 #include "platform/LengthFunctions.h"
59 #include "platform/geometry/FloatRect.h" 60 #include "platform/geometry/FloatRect.h"
60 #include "platform/transforms/AffineTransform.h" 61 #include "platform/transforms/AffineTransform.h"
61 #include "wtf/StdLibExtras.h" 62 #include "wtf/StdLibExtras.h"
62 63
63 namespace WebCore { 64 namespace WebCore {
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after
392 PassRefPtr<SVGAngleTearOff> SVGSVGElement::createSVGAngle() 393 PassRefPtr<SVGAngleTearOff> SVGSVGElement::createSVGAngle()
393 { 394 {
394 return SVGAngleTearOff::create(SVGAngle::create(), 0, PropertyIsNotAnimVal); 395 return SVGAngleTearOff::create(SVGAngle::create(), 0, PropertyIsNotAnimVal);
395 } 396 }
396 397
397 PassRefPtr<SVGPointTearOff> SVGSVGElement::createSVGPoint() 398 PassRefPtr<SVGPointTearOff> SVGSVGElement::createSVGPoint()
398 { 399 {
399 return SVGPointTearOff::create(SVGPoint::create(), 0, PropertyIsNotAnimVal); 400 return SVGPointTearOff::create(SVGPoint::create(), 0, PropertyIsNotAnimVal);
400 } 401 }
401 402
402 SVGMatrix SVGSVGElement::createSVGMatrix() 403 PassRefPtr<SVGMatrixTearOff> SVGSVGElement::createSVGMatrix()
403 { 404 {
404 return SVGMatrix(); 405 return SVGMatrixTearOff::create(AffineTransform());
405 } 406 }
406 407
407 PassRefPtr<SVGRectTearOff> SVGSVGElement::createSVGRect() 408 PassRefPtr<SVGRectTearOff> SVGSVGElement::createSVGRect()
408 { 409 {
409 return SVGRectTearOff::create(SVGRect::create(), 0, PropertyIsNotAnimVal); 410 return SVGRectTearOff::create(SVGRect::create(), 0, PropertyIsNotAnimVal);
410 } 411 }
411 412
412 SVGTransform SVGSVGElement::createSVGTransform() 413 PassRefPtr<SVGTransformTearOff> SVGSVGElement::createSVGTransform()
413 { 414 {
414 return SVGTransform(SVGTransform::SVG_TRANSFORM_MATRIX); 415 return SVGTransformTearOff::create(SVGTransform::create(SVG_TRANSFORM_MATRIX ), 0, PropertyIsNotAnimVal);
415 } 416 }
416 417
417 SVGTransform SVGSVGElement::createSVGTransformFromMatrix(const SVGMatrix& matrix ) 418 PassRefPtr<SVGTransformTearOff> SVGSVGElement::createSVGTransformFromMatrix(Pass RefPtr<SVGMatrixTearOff> matrix)
418 { 419 {
419 return SVGTransform(static_cast<const AffineTransform&>(matrix)); 420 return SVGTransformTearOff::create(SVGTransform::create(matrix->value()), 0, PropertyIsNotAnimVal);
420 } 421 }
421 422
422 AffineTransform SVGSVGElement::localCoordinateSpaceTransform(SVGElement::CTMScop e mode) const 423 AffineTransform SVGSVGElement::localCoordinateSpaceTransform(SVGElement::CTMScop e mode) const
423 { 424 {
424 AffineTransform viewBoxTransform; 425 AffineTransform viewBoxTransform;
425 if (!hasEmptyViewBox()) { 426 if (!hasEmptyViewBox()) {
426 FloatSize size = currentViewportSize(); 427 FloatSize size = currentViewportSize();
427 viewBoxTransform = viewBoxToViewTransform(size.width(), size.height()); 428 viewBoxTransform = viewBoxToViewTransform(size.width(), size.height());
428 } 429 }
429 430
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
668 ASSERT(renderer()); 669 ASSERT(renderer());
669 return renderer()->style()->height(); 670 return renderer()->style()->height();
670 } 671 }
671 672
672 AffineTransform SVGSVGElement::viewBoxToViewTransform(float viewWidth, float vie wHeight) const 673 AffineTransform SVGSVGElement::viewBoxToViewTransform(float viewWidth, float vie wHeight) const
673 { 674 {
674 if (!m_useCurrentView || !m_viewSpec) 675 if (!m_useCurrentView || !m_viewSpec)
675 return SVGFitToViewBox::viewBoxToViewTransform(currentViewBoxRect(), pre serveAspectRatio()->currentValue(), viewWidth, viewHeight); 676 return SVGFitToViewBox::viewBoxToViewTransform(currentViewBoxRect(), pre serveAspectRatio()->currentValue(), viewWidth, viewHeight);
676 677
677 AffineTransform ctm = SVGFitToViewBox::viewBoxToViewTransform(currentViewBox Rect(), m_viewSpec->preserveAspectRatio()->currentValue(), viewWidth, viewHeight ); 678 AffineTransform ctm = SVGFitToViewBox::viewBoxToViewTransform(currentViewBox Rect(), m_viewSpec->preserveAspectRatio()->currentValue(), viewWidth, viewHeight );
678 const SVGTransformList& transformList = m_viewSpec->transformBaseValue(); 679 RefPtr<SVGTransformList> transformList = m_viewSpec->transform();
679 if (transformList.isEmpty()) 680 if (transformList->isEmpty())
680 return ctm; 681 return ctm;
681 682
682 AffineTransform transform; 683 AffineTransform transform;
683 if (transformList.concatenate(transform)) 684 if (transformList->concatenate(transform))
684 ctm *= transform; 685 ctm *= transform;
685 686
686 return ctm; 687 return ctm;
687 } 688 }
688 689
689 void SVGSVGElement::setupInitialView(const String& fragmentIdentifier, Element* anchorNode) 690 void SVGSVGElement::setupInitialView(const String& fragmentIdentifier, Element* anchorNode)
690 { 691 {
691 RenderObject* renderer = this->renderer(); 692 RenderObject* renderer = this->renderer();
692 SVGViewSpec* view = m_viewSpec.get(); 693 SVGViewSpec* view = m_viewSpec.get();
693 if (view) 694 if (view)
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
777 continue; 778 continue;
778 779
779 Element* element = toElement(node); 780 Element* element = toElement(node);
780 if (element->getIdAttribute() == id) 781 if (element->getIdAttribute() == id)
781 return element; 782 return element;
782 } 783 }
783 return 0; 784 return 0;
784 } 785 }
785 786
786 } 787 }
OLDNEW
« no previous file with comments | « Source/core/svg/SVGSVGElement.h ('k') | Source/core/svg/SVGTextElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698