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

Side by Side Diff: Source/core/layout/svg/LayoutSVGTransformableContainer.cpp

Issue 1162383003: C++11: Replace 0 with nullptr where applicable in layout code. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add one more file. Created 5 years, 6 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2005 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2004, 2005 Nikolas Zimmermann <zimmermann@kde.org>
3 * Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org> 3 * Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org>
4 * Copyright (C) 2009 Google, Inc. 4 * Copyright (C) 2009 Google, Inc.
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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 } 70 }
71 71
72 bool LayoutSVGTransformableContainer::calculateLocalTransform() 72 bool LayoutSVGTransformableContainer::calculateLocalTransform()
73 { 73 {
74 SVGGraphicsElement* element = toSVGGraphicsElement(this->element()); 74 SVGGraphicsElement* element = toSVGGraphicsElement(this->element());
75 ASSERT(element); 75 ASSERT(element);
76 76
77 // If we're either the layoutObject for a <use> element, or for any <g> elem ent inside the shadow 77 // If we're either the layoutObject for a <use> element, or for any <g> elem ent inside the shadow
78 // tree, that was created during the use/symbol/svg expansion in SVGUseEleme nt. These containers 78 // tree, that was created during the use/symbol/svg expansion in SVGUseEleme nt. These containers
79 // need to respect the translations induced by their corresponding use eleme nts x/y attributes. 79 // need to respect the translations induced by their corresponding use eleme nts x/y attributes.
80 SVGUseElement* useElement = 0; 80 SVGUseElement* useElement = nullptr;
81 if (isSVGUseElement(*element)) { 81 if (isSVGUseElement(*element)) {
82 useElement = toSVGUseElement(element); 82 useElement = toSVGUseElement(element);
83 } else if (isSVGGElement(*element) && toSVGGElement(element)->inUseShadowTre e()) { 83 } else if (isSVGGElement(*element) && toSVGGElement(element)->inUseShadowTre e()) {
84 SVGElement* correspondingElement = element->correspondingElement(); 84 SVGElement* correspondingElement = element->correspondingElement();
85 if (isSVGUseElement(correspondingElement)) 85 if (isSVGUseElement(correspondingElement))
86 useElement = toSVGUseElement(correspondingElement); 86 useElement = toSVGUseElement(correspondingElement);
87 } 87 }
88 88
89 if (useElement) { 89 if (useElement) {
90 SVGLengthContext lengthContext(useElement); 90 SVGLengthContext lengthContext(useElement);
91 FloatSize translation( 91 FloatSize translation(
92 useElement->x()->currentValue()->value(lengthContext), 92 useElement->x()->currentValue()->value(lengthContext),
93 useElement->y()->currentValue()->value(lengthContext)); 93 useElement->y()->currentValue()->value(lengthContext));
94 if (translation != m_lastTranslation) 94 if (translation != m_lastTranslation)
95 m_needsTransformUpdate = true; 95 m_needsTransformUpdate = true;
96 m_lastTranslation = translation; 96 m_lastTranslation = translation;
97 } 97 }
98 98
99 m_didTransformToRootUpdate = m_needsTransformUpdate || SVGLayoutSupport::tra nsformToRootChanged(parent()); 99 m_didTransformToRootUpdate = m_needsTransformUpdate || SVGLayoutSupport::tra nsformToRootChanged(parent());
100 if (!m_needsTransformUpdate) 100 if (!m_needsTransformUpdate)
101 return false; 101 return false;
102 102
103 m_localTransform = element->calculateAnimatedLocalTransform(); 103 m_localTransform = element->calculateAnimatedLocalTransform();
104 m_localTransform.translate(m_lastTranslation.width(), m_lastTranslation.heig ht()); 104 m_localTransform.translate(m_lastTranslation.width(), m_lastTranslation.heig ht());
105 m_needsTransformUpdate = false; 105 m_needsTransformUpdate = false;
106 return true; 106 return true;
107 } 107 }
108 108
109 } 109 }
OLDNEW
« no previous file with comments | « Source/core/layout/svg/LayoutSVGText.cpp ('k') | Source/core/layout/svg/ReferenceFilterBuilder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698