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

Side by Side Diff: Source/core/svg/SVGTransformDistance.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
« no previous file with comments | « Source/core/svg/SVGTransformDistance.h ('k') | Source/core/svg/SVGTransformList.h » ('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) 2007 Eric Seidel <eric@webkit.org> 2 * Copyright (C) 2007 Eric Seidel <eric@webkit.org>
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 26 matching lines...) Expand all
37 37
38 SVGTransformDistance::SVGTransformDistance(SVGTransformType transformType, float angle, float cx, float cy, const AffineTransform& transform) 38 SVGTransformDistance::SVGTransformDistance(SVGTransformType transformType, float angle, float cx, float cy, const AffineTransform& transform)
39 : m_transformType(transformType) 39 : m_transformType(transformType)
40 , m_angle(angle) 40 , m_angle(angle)
41 , m_cx(cx) 41 , m_cx(cx)
42 , m_cy(cy) 42 , m_cy(cy)
43 , m_transform(transform) 43 , m_transform(transform)
44 { 44 {
45 } 45 }
46 46
47 SVGTransformDistance::SVGTransformDistance(PassRefPtr<SVGTransform> passFromSVGT ransform, PassRefPtr<SVGTransform> passToSVGTransform) 47 SVGTransformDistance::SVGTransformDistance(PassRefPtrWillBeRawPtr<SVGTransform> passFromSVGTransform, PassRefPtrWillBeRawPtr<SVGTransform> passToSVGTransform)
48 : m_angle(0) 48 : m_angle(0)
49 , m_cx(0) 49 , m_cx(0)
50 , m_cy(0) 50 , m_cy(0)
51 { 51 {
52 RefPtr<SVGTransform> fromSVGTransform = passFromSVGTransform; 52 RefPtrWillBeRawPtr<SVGTransform> fromSVGTransform = passFromSVGTransform;
53 RefPtr<SVGTransform> toSVGTransform = passToSVGTransform; 53 RefPtrWillBeRawPtr<SVGTransform> toSVGTransform = passToSVGTransform;
54 54
55 m_transformType = fromSVGTransform->transformType(); 55 m_transformType = fromSVGTransform->transformType();
56 ASSERT(m_transformType == toSVGTransform->transformType()); 56 ASSERT(m_transformType == toSVGTransform->transformType());
57 57
58 switch (m_transformType) { 58 switch (m_transformType) {
59 case SVG_TRANSFORM_MATRIX: 59 case SVG_TRANSFORM_MATRIX:
60 ASSERT_NOT_REACHED(); 60 ASSERT_NOT_REACHED();
61 case SVG_TRANSFORM_UNKNOWN: 61 case SVG_TRANSFORM_UNKNOWN:
62 break; 62 break;
63 case SVG_TRANSFORM_ROTATE: { 63 case SVG_TRANSFORM_ROTATE: {
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 } 104 }
105 case SVG_TRANSFORM_SKEWX: 105 case SVG_TRANSFORM_SKEWX:
106 case SVG_TRANSFORM_SKEWY: 106 case SVG_TRANSFORM_SKEWY:
107 return SVGTransformDistance(m_transformType, m_angle * scaleFactor, m_cx * scaleFactor, m_cy * scaleFactor, AffineTransform()); 107 return SVGTransformDistance(m_transformType, m_angle * scaleFactor, m_cx * scaleFactor, m_cy * scaleFactor, AffineTransform());
108 } 108 }
109 109
110 ASSERT_NOT_REACHED(); 110 ASSERT_NOT_REACHED();
111 return SVGTransformDistance(); 111 return SVGTransformDistance();
112 } 112 }
113 113
114 PassRefPtr<SVGTransform> SVGTransformDistance::addSVGTransforms(PassRefPtr<SVGTr ansform> passFirst, PassRefPtr<SVGTransform> passSecond, unsigned repeatCount) 114 PassRefPtrWillBeRawPtr<SVGTransform> SVGTransformDistance::addSVGTransforms(Pass RefPtrWillBeRawPtr<SVGTransform> passFirst, PassRefPtrWillBeRawPtr<SVGTransform> passSecond, unsigned repeatCount)
115 { 115 {
116 RefPtr<SVGTransform> first = passFirst; 116 RefPtrWillBeRawPtr<SVGTransform> first = passFirst;
117 RefPtr<SVGTransform> second = passSecond; 117 RefPtrWillBeRawPtr<SVGTransform> second = passSecond;
118 ASSERT(first->transformType() == second->transformType()); 118 ASSERT(first->transformType() == second->transformType());
119 119
120 RefPtr<SVGTransform> transform = SVGTransform::create(); 120 RefPtrWillBeRawPtr<SVGTransform> transform = SVGTransform::create();
121 121
122 switch (first->transformType()) { 122 switch (first->transformType()) {
123 case SVG_TRANSFORM_MATRIX: 123 case SVG_TRANSFORM_MATRIX:
124 ASSERT_NOT_REACHED(); 124 ASSERT_NOT_REACHED();
125 case SVG_TRANSFORM_UNKNOWN: 125 case SVG_TRANSFORM_UNKNOWN:
126 return transform.release(); 126 return transform.release();
127 case SVG_TRANSFORM_ROTATE: { 127 case SVG_TRANSFORM_ROTATE: {
128 transform->setRotate(first->angle() + second->angle() * repeatCount, fir st->rotationCenter().x() + second->rotationCenter().x() * repeatCount, first->ro tationCenter().y() + second->rotationCenter().y() * repeatCount); 128 transform->setRotate(first->angle() + second->angle() * repeatCount, fir st->rotationCenter().x() + second->rotationCenter().x() * repeatCount, first->ro tationCenter().y() + second->rotationCenter().y() * repeatCount);
129 return transform.release(); 129 return transform.release();
130 } 130 }
(...skipping 14 matching lines...) Expand all
145 transform->setSkewX(first->angle() + second->angle() * repeatCount); 145 transform->setSkewX(first->angle() + second->angle() * repeatCount);
146 return transform.release(); 146 return transform.release();
147 case SVG_TRANSFORM_SKEWY: 147 case SVG_TRANSFORM_SKEWY:
148 transform->setSkewY(first->angle() + second->angle() * repeatCount); 148 transform->setSkewY(first->angle() + second->angle() * repeatCount);
149 return transform.release(); 149 return transform.release();
150 } 150 }
151 ASSERT_NOT_REACHED(); 151 ASSERT_NOT_REACHED();
152 return transform.release(); 152 return transform.release();
153 } 153 }
154 154
155 PassRefPtr<SVGTransform> SVGTransformDistance::addToSVGTransform(PassRefPtr<SVGT ransform> passTransform) const 155 PassRefPtrWillBeRawPtr<SVGTransform> SVGTransformDistance::addToSVGTransform(Pas sRefPtrWillBeRawPtr<SVGTransform> passTransform) const
156 { 156 {
157 RefPtr<SVGTransform> transform = passTransform; 157 RefPtrWillBeRawPtr<SVGTransform> transform = passTransform;
158 ASSERT(m_transformType == transform->transformType() || m_transformType == S VG_TRANSFORM_UNKNOWN); 158 ASSERT(m_transformType == transform->transformType() || m_transformType == S VG_TRANSFORM_UNKNOWN);
159 159
160 RefPtr<SVGTransform> newTransform = transform->clone(); 160 RefPtrWillBeRawPtr<SVGTransform> newTransform = transform->clone();
161 161
162 switch (m_transformType) { 162 switch (m_transformType) {
163 case SVG_TRANSFORM_MATRIX: 163 case SVG_TRANSFORM_MATRIX:
164 ASSERT_NOT_REACHED(); 164 ASSERT_NOT_REACHED();
165 case SVG_TRANSFORM_UNKNOWN: 165 case SVG_TRANSFORM_UNKNOWN:
166 return SVGTransform::create(); 166 return SVGTransform::create();
167 case SVG_TRANSFORM_TRANSLATE: { 167 case SVG_TRANSFORM_TRANSLATE: {
168 FloatPoint translation = transform->translate(); 168 FloatPoint translation = transform->translate();
169 translation += FloatSize::narrowPrecision(m_transform.e(), m_transform.f ()); 169 translation += FloatSize::narrowPrecision(m_transform.e(), m_transform.f ());
170 newTransform->setTranslate(translation.x(), translation.y()); 170 newTransform->setTranslate(translation.x(), translation.y());
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 return static_cast<float>(sqrt(m_transform.e() * m_transform.e() + m_tra nsform.f() * m_transform.f())); 208 return static_cast<float>(sqrt(m_transform.e() * m_transform.e() + m_tra nsform.f() * m_transform.f()));
209 case SVG_TRANSFORM_SKEWX: 209 case SVG_TRANSFORM_SKEWX:
210 case SVG_TRANSFORM_SKEWY: 210 case SVG_TRANSFORM_SKEWY:
211 return m_angle; 211 return m_angle;
212 } 212 }
213 ASSERT_NOT_REACHED(); 213 ASSERT_NOT_REACHED();
214 return 0; 214 return 0;
215 } 215 }
216 216
217 } 217 }
OLDNEW
« no previous file with comments | « Source/core/svg/SVGTransformDistance.h ('k') | Source/core/svg/SVGTransformList.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698