Changeset 184070 in webkit
- Timestamp:
- May 11, 2015, 1:52:35 AM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
-
ChangeLog (modified) (1 diff)
-
css/WebKitCSSMatrix.cpp (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r184069 r184070 1 2015-05-11 Zan Dobersek <zdobersek@igalia.com> 2 3 Reduce TransformationMatrix copies in WebKitCSSMatrix operations 4 https://bugs.webkit.org/show_bug.cgi?id=144795 5 6 Reviewed by Darin Adler. 7 8 Instead of copying the TransformationMatrix member, performing 9 the operation on it and then copying it again when creating 10 the new WebKitCSSMatrix object, copy it just once by first 11 creating the new WebKitCSSMatrix object and then performing 12 the operation on that object's TransformationMatrix directly. 13 14 * css/WebKitCSSMatrix.cpp: 15 (WebCore::WebKitCSSMatrix::multiply): 16 (WebCore::WebKitCSSMatrix::translate): 17 (WebCore::WebKitCSSMatrix::scale): 18 (WebCore::WebKitCSSMatrix::rotate): 19 (WebCore::WebKitCSSMatrix::rotateAxisAngle): 20 (WebCore::WebKitCSSMatrix::skewX): 21 (WebCore::WebKitCSSMatrix::skewY): 22 1 23 2015-05-11 Zan Dobersek <zdobersek@igalia.com> 2 24 -
trunk/Source/WebCore/css/WebKitCSSMatrix.cpp
r183017 r184070 93 93 { 94 94 if (!secondMatrix) 95 return 0; 96 97 return WebKitCSSMatrix::create(TransformationMatrix(m_matrix).multiply(secondMatrix->m_matrix)); 95 return nullptr; 96 97 RefPtr<WebKitCSSMatrix> matrix = WebKitCSSMatrix::create(m_matrix); 98 matrix->m_matrix.multiply(secondMatrix->m_matrix); 99 return matrix.release(); 98 100 } 99 101 … … 116 118 if (std::isnan(z)) 117 119 z = 0; 118 return WebKitCSSMatrix::create(TransformationMatrix(m_matrix).translate3d(x, y, z)); 120 121 RefPtr<WebKitCSSMatrix> matrix = WebKitCSSMatrix::create(m_matrix); 122 matrix->m_matrix.translate3d(x, y, z); 123 return matrix.release(); 119 124 } 120 125 … … 127 132 if (std::isnan(scaleZ)) 128 133 scaleZ = 1; 129 return WebKitCSSMatrix::create(TransformationMatrix(m_matrix).scale3d(scaleX, scaleY, scaleZ)); 134 135 RefPtr<WebKitCSSMatrix> matrix = WebKitCSSMatrix::create(m_matrix); 136 matrix->m_matrix.scale3d(scaleX, scaleY, scaleZ); 137 return matrix.release(); 130 138 } 131 139 … … 145 153 if (std::isnan(rotZ)) 146 154 rotZ = 0; 147 return WebKitCSSMatrix::create(TransformationMatrix(m_matrix).rotate3d(rotX, rotY, rotZ)); 155 156 RefPtr<WebKitCSSMatrix> matrix = WebKitCSSMatrix::create(m_matrix); 157 matrix->m_matrix.rotate3d(rotX, rotY, rotZ); 158 return matrix.release(); 148 159 } 149 160 … … 160 171 if (x == 0 && y == 0 && z == 0) 161 172 z = 1; 162 return WebKitCSSMatrix::create(TransformationMatrix(m_matrix).rotate3d(x, y, z, angle)); 173 174 RefPtr<WebKitCSSMatrix> matrix = WebKitCSSMatrix::create(m_matrix); 175 matrix->m_matrix.rotate3d(x, y, z, angle); 176 return matrix.release(); 163 177 } 164 178 … … 167 181 if (std::isnan(angle)) 168 182 angle = 0; 169 return WebKitCSSMatrix::create(TransformationMatrix(m_matrix).skewX(angle)); 183 184 RefPtr<WebKitCSSMatrix> matrix = WebKitCSSMatrix::create(m_matrix); 185 matrix->m_matrix.skewX(angle); 186 return matrix.release(); 170 187 } 171 188 … … 174 191 if (std::isnan(angle)) 175 192 angle = 0; 176 return WebKitCSSMatrix::create(TransformationMatrix(m_matrix).skewY(angle)); 193 194 RefPtr<WebKitCSSMatrix> matrix = WebKitCSSMatrix::create(m_matrix); 195 matrix->m_matrix.skewY(angle); 196 return matrix.release(); 177 197 } 178 198
Note:
See TracChangeset
for help on using the changeset viewer.