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

Side by Side Diff: cc/math_util.h

Issue 11366089: cc: Remove all remaining use of WebCore Rect/Point/Size types from the compositor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove gyp entries for stubs Created 8 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 | Annotate | Revision Log
« no previous file with comments | « cc/layer_unittest.cc ('k') | cc/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_MATH_UTIL_H_ 5 #ifndef CC_MATH_UTIL_H_
6 #define CC_MATH_UTIL_H_ 6 #define CC_MATH_UTIL_H_
7 7
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "cc/cc_export.h" 9 #include "cc/cc_export.h"
10 #include "ui/gfx/point_f.h" 10 #include "ui/gfx/point_f.h"
11 #include "ui/gfx/point3_f.h" 11 #include "ui/gfx/point3_f.h"
12 12
13 namespace WebKit { 13 namespace WebKit {
14 class WebTransformationMatrix; 14 class WebTransformationMatrix;
15 } 15 }
16 16
17 namespace gfx { 17 namespace gfx {
18 class QuadF; 18 class QuadF;
19 class Rect; 19 class Rect;
20 class RectF; 20 class RectF;
21 class Vector2dF;
21 } 22 }
22 23
23 namespace cc { 24 namespace cc {
24 25
25 class FloatSize;
26
27 struct HomogeneousCoordinate { 26 struct HomogeneousCoordinate {
28 HomogeneousCoordinate(double newX, double newY, double newZ, double newW) 27 HomogeneousCoordinate(double newX, double newY, double newZ, double newW)
29 : x(newX) 28 : x(newX)
30 , y(newY) 29 , y(newY)
31 , z(newZ) 30 , z(newZ)
32 , w(newW) 31 , w(newW)
33 { 32 {
34 } 33 }
35 34
36 bool shouldBeClipped() const 35 bool shouldBeClipped() const
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 static gfx::Point3F mapPoint(const WebKit::WebTransformationMatrix&, const g fx::Point3F&, bool& clipped); 96 static gfx::Point3F mapPoint(const WebKit::WebTransformationMatrix&, const g fx::Point3F&, bool& clipped);
98 static gfx::QuadF projectQuad(const WebKit::WebTransformationMatrix&, const gfx::QuadF&, bool& clipped); 97 static gfx::QuadF projectQuad(const WebKit::WebTransformationMatrix&, const gfx::QuadF&, bool& clipped);
99 static gfx::PointF projectPoint(const WebKit::WebTransformationMatrix&, cons t gfx::PointF&, bool& clipped); 98 static gfx::PointF projectPoint(const WebKit::WebTransformationMatrix&, cons t gfx::PointF&, bool& clipped);
100 99
101 static void flattenTransformTo2d(WebKit::WebTransformationMatrix&); 100 static void flattenTransformTo2d(WebKit::WebTransformationMatrix&);
102 101
103 static gfx::Vector2dF computeTransform2dScaleComponents(const WebKit::WebTra nsformationMatrix&); 102 static gfx::Vector2dF computeTransform2dScaleComponents(const WebKit::WebTra nsformationMatrix&);
104 103
105 // Returns the smallest angle between the given two vectors in degrees. Neit her vector is 104 // Returns the smallest angle between the given two vectors in degrees. Neit her vector is
106 // assumed to be normalized. 105 // assumed to be normalized.
107 static float smallestAngleBetweenVectors(const FloatSize&, const FloatSize&) ; 106 static float smallestAngleBetweenVectors(gfx::Vector2dF, gfx::Vector2dF);
108 107
109 // Projects the |source| vector onto |destination|. Neither vector is assume d to be normalized. 108 // Projects the |source| vector onto |destination|. Neither vector is assume d to be normalized.
110 static FloatSize projectVector(const FloatSize& source, const FloatSize& des tination); 109 static gfx::Vector2dF projectVector(gfx::Vector2dF source, gfx::Vector2dF de stination);
111 }; 110 };
112 111
113 } // namespace cc 112 } // namespace cc
114 113
115 #endif // CC_MATH_UTIL_H_ 114 #endif // CC_MATH_UTIL_H_
OLDNEW
« no previous file with comments | « cc/layer_unittest.cc ('k') | cc/math_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698