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

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

Issue 2265453003: Add platform/transforms pretty printers for logging and testing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update per reviewer comments Created 4 years, 3 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 * 2010 Dirk Schulze <krit@webkit.org> 3 * 2010 Dirk Schulze <krit@webkit.org>
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 } DecomposedType; 176 } DecomposedType;
177 177
178 bool decompose(DecomposedType&) const; 178 bool decompose(DecomposedType&) const;
179 void recompose(const DecomposedType&); 179 void recompose(const DecomposedType&);
180 180
181 void copyTransformTo(Transform m) 181 void copyTransformTo(Transform m)
182 { 182 {
183 memcpy(m, m_transform, sizeof(Transform)); 183 memcpy(m, m_transform, sizeof(Transform));
184 } 184 }
185 185
186 // If |asMatrix| is true, the transform is returned as a matrix in row-major
187 // order. Otherwise, the transform's decomposition is returned which shows
188 // the translation, scale, etc.
189 String toString(bool asMatrix = false) const;
190
186 private: 191 private:
187 void setMatrix(const Transform m) 192 void setMatrix(const Transform m)
188 { 193 {
189 if (m && m != m_transform) 194 if (m && m != m_transform)
190 memcpy(m_transform, m, sizeof(Transform)); 195 memcpy(m_transform, m, sizeof(Transform));
191 } 196 }
192 197
193 Transform m_transform; 198 Transform m_transform;
194 }; 199 };
195 200
196 // Redeclared here to avoid ODR issues. 201 // Redeclared here to avoid ODR issues.
197 // See platform/testing/TransformPrinters.h. 202 // See platform/testing/TransformPrinters.h.
198 void PrintTo(const AffineTransform&, std::ostream*); 203 void PrintTo(const AffineTransform&, std::ostream*);
199 204
200 } // namespace blink 205 } // namespace blink
201 206
202 #endif 207 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698