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

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

Issue 2482753002: Fix matrix3d transform under page zoom (Closed)
Patch Set: Add a comment for zoom Created 4 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
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 319 matching lines...) Expand 10 before | Expand all | Expand 10 after
330 TransformationMatrix& skewY(double angle) { return skew(0, angle); } 330 TransformationMatrix& skewY(double angle) { return skew(0, angle); }
331 331
332 TransformationMatrix& applyPerspective(double p); 332 TransformationMatrix& applyPerspective(double p);
333 333
334 // Changes the transform to apply as if the origin were at (x, y, z). 334 // Changes the transform to apply as if the origin were at (x, y, z).
335 TransformationMatrix& applyTransformOrigin(double x, double y, double z); 335 TransformationMatrix& applyTransformOrigin(double x, double y, double z);
336 TransformationMatrix& applyTransformOrigin(const FloatPoint3D& origin) { 336 TransformationMatrix& applyTransformOrigin(const FloatPoint3D& origin) {
337 return applyTransformOrigin(origin.x(), origin.y(), origin.z()); 337 return applyTransformOrigin(origin.x(), origin.y(), origin.z());
338 } 338 }
339 339
340 // Changes the transform to:
341 //
342 // scale3d(z, z, z) * mat * scale3d(1/z, 1/z, 1/z)
343 //
344 // Useful for mapping zoomed points to their zoomed transformed result:
345 //
346 // new_mat * (scale3d(z, z, z) * x) == scale3d(z, z, z) * (mat * x)
347 //
alancutter (OOO until 2018) 2016/11/10 06:50:03 Nice comment! I'd even put this in the description
348 TransformationMatrix& zoom(double zoomFactor);
349
340 bool isInvertible() const; 350 bool isInvertible() const;
341 351
342 // This method returns the identity matrix if it is not invertible. 352 // This method returns the identity matrix if it is not invertible.
343 // Use isInvertible() before calling this if you need to know. 353 // Use isInvertible() before calling this if you need to know.
344 TransformationMatrix inverse() const; 354 TransformationMatrix inverse() const;
345 355
346 // decompose the matrix into its component parts 356 // decompose the matrix into its component parts
347 typedef struct { 357 typedef struct {
348 double scaleX, scaleY, scaleZ; 358 double scaleX, scaleY, scaleZ;
349 double skewXY, skewXZ, skewYZ; 359 double skewXY, skewXZ, skewYZ;
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
479 Matrix4 m_matrix; 489 Matrix4 m_matrix;
480 }; 490 };
481 491
482 // Redeclared here to avoid ODR issues. 492 // Redeclared here to avoid ODR issues.
483 // See platform/testing/TransformPrinters.h. 493 // See platform/testing/TransformPrinters.h.
484 void PrintTo(const TransformationMatrix&, std::ostream*); 494 void PrintTo(const TransformationMatrix&, std::ostream*);
485 495
486 } // namespace blink 496 } // namespace blink
487 497
488 #endif // TransformationMatrix_h 498 #endif // TransformationMatrix_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698