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

Side by Side Diff: cc/base/math_util.h

Issue 1135813005: Add detection for rotation and flip overlay transforms (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix mojo surfaces unit test, chase flipped rename to TextureQuadState Created 5 years, 7 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
« no previous file with comments | « no previous file | cc/base/math_util.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CC_BASE_MATH_UTIL_H_ 5 #ifndef CC_BASE_MATH_UTIL_H_
6 #define CC_BASE_MATH_UTIL_H_ 6 #define CC_BASE_MATH_UTIL_H_
7 7
8 #include <algorithm> 8 #include <algorithm>
9 #include <cmath> 9 #include <cmath>
10 #include <vector> 10 #include <vector>
(...skipping 15 matching lines...) Expand all
26 } 26 }
27 } // namespace base 27 } // namespace base
28 28
29 namespace gfx { 29 namespace gfx {
30 class QuadF; 30 class QuadF;
31 class Rect; 31 class Rect;
32 class RectF; 32 class RectF;
33 class Transform; 33 class Transform;
34 class Vector2dF; 34 class Vector2dF;
35 class Vector2d; 35 class Vector2d;
36 class Vector3dF;
36 } 37 }
37 38
38 namespace cc { 39 namespace cc {
39 40
40 struct HomogeneousCoordinate { 41 struct HomogeneousCoordinate {
41 HomogeneousCoordinate(SkMScalar x, SkMScalar y, SkMScalar z, SkMScalar w) { 42 HomogeneousCoordinate(SkMScalar x, SkMScalar y, SkMScalar z, SkMScalar w) {
42 vec[0] = x; 43 vec[0] = x;
43 vec[1] = y; 44 vec[1] = y;
44 vec[2] = z; 45 vec[2] = z;
45 vec[3] = w; 46 vec[3] = w;
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 const gfx::Transform& transform, 234 const gfx::Transform& transform,
234 base::trace_event::TracedValue* res); 235 base::trace_event::TracedValue* res);
235 static void AddToTracedValue(const char* name, 236 static void AddToTracedValue(const char* name,
236 const gfx::BoxF& box, 237 const gfx::BoxF& box,
237 base::trace_event::TracedValue* res); 238 base::trace_event::TracedValue* res);
238 239
239 // Returns a base::Value representation of the floating point value. 240 // Returns a base::Value representation of the floating point value.
240 // If the value is inf, returns max double/float representation. 241 // If the value is inf, returns max double/float representation.
241 static double AsDoubleSafely(double value); 242 static double AsDoubleSafely(double value);
242 static float AsFloatSafely(float value); 243 static float AsFloatSafely(float value);
244
245 // Returns vector that x axis (1,0,0) transforms to under given transform.
246 static gfx::Vector3dF GetXAxis(const gfx::Transform& transform);
247
248 // Returns vector that y axis (0,1,0) transforms to under given transform.
249 static gfx::Vector3dF GetYAxis(const gfx::Transform& transform);
243 }; 250 };
244 251
245 } // namespace cc 252 } // namespace cc
246 253
247 #endif // CC_BASE_MATH_UTIL_H_ 254 #endif // CC_BASE_MATH_UTIL_H_
OLDNEW
« no previous file with comments | « no previous file | cc/base/math_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698