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

Side by Side Diff: third_party/WebKit/Source/platform/transforms/TransformationMatrix.h

Issue 1777613002: Add localToAbsoluteTransform and localToAncestorTransform. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address feedback about comments Created 4 years, 9 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) 2005, 2006 Apple Computer, Inc. All rights reserved. 2 * Copyright (C) 2005, 2006 Apple Computer, Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 { 312 {
313 return m13() == 0 && m14() == 0 && m23() == 0 && m24() == 0 313 return m13() == 0 && m14() == 0 && m23() == 0 && m24() == 0
314 && m31() == 0 && m32() == 0 && m33() == 1 && m34() == 0 && m43() == 0 && m44() == 1; 314 && m31() == 0 && m32() == 0 && m33() == 1 && m34() == 0 && m43() == 0 && m44() == 1;
315 } 315 }
316 316
317 // Throw away the non-affine parts of the matrix (lossy!) 317 // Throw away the non-affine parts of the matrix (lossy!)
318 void makeAffine(); 318 void makeAffine();
319 319
320 AffineTransform toAffineTransform() const; 320 AffineTransform toAffineTransform() const;
321 321
322 // Flatten into a 2-D transformation (non-invertable).
323 // Same as gfx::Transform::FlattenTo2d(); see the docs for that function for details and discussion.
324 void flattenTo2d();
325
322 bool operator==(const TransformationMatrix& m2) const 326 bool operator==(const TransformationMatrix& m2) const
323 { 327 {
324 return m_matrix[0][0] == m2.m_matrix[0][0] 328 return m_matrix[0][0] == m2.m_matrix[0][0]
325 && m_matrix[0][1] == m2.m_matrix[0][1] 329 && m_matrix[0][1] == m2.m_matrix[0][1]
326 && m_matrix[0][2] == m2.m_matrix[0][2] 330 && m_matrix[0][2] == m2.m_matrix[0][2]
327 && m_matrix[0][3] == m2.m_matrix[0][3] 331 && m_matrix[0][3] == m2.m_matrix[0][3]
328 && m_matrix[1][0] == m2.m_matrix[1][0] 332 && m_matrix[1][0] == m2.m_matrix[1][0]
329 && m_matrix[1][1] == m2.m_matrix[1][1] 333 && m_matrix[1][1] == m2.m_matrix[1][1]
330 && m_matrix[1][2] == m2.m_matrix[1][2] 334 && m_matrix[1][2] == m2.m_matrix[1][2]
331 && m_matrix[1][3] == m2.m_matrix[1][3] 335 && m_matrix[1][3] == m2.m_matrix[1][3]
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
419 Matrix4 m_matrix; 423 Matrix4 m_matrix;
420 }; 424 };
421 425
422 // Redeclared here to avoid ODR issues. 426 // Redeclared here to avoid ODR issues.
423 // See platform/testing/TransformPrinters.h. 427 // See platform/testing/TransformPrinters.h.
424 void PrintTo(const TransformationMatrix&, std::ostream*); 428 void PrintTo(const TransformationMatrix&, std::ostream*);
425 429
426 } // namespace blink 430 } // namespace blink
427 431
428 #endif // TransformationMatrix_h 432 #endif // TransformationMatrix_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698