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

Unified Diff: cc/layer_sorter.cc

Issue 11369018: cc: Switch from WebCore::FloatPoint3D to gfx::Point3F and gfx::Vector3dF in the compositor (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Missing base files Created 8 years, 2 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 side-by-side diff with in-line comments
Download patch
« cc/cc.gyp ('K') | « cc/layer_sorter.h ('k') | cc/math_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layer_sorter.cc
diff --git a/cc/layer_sorter.cc b/cc/layer_sorter.cc
index c09211b045ed92cdc1bdb0691bd9c26008dd6218..e251e11dc5e8d9764bf5997e6233d01a6b5c5667 100644
--- a/cc/layer_sorter.cc
+++ b/cc/layer_sorter.cc
@@ -179,13 +179,13 @@ LayerShape::LayerShape(float width, float height, const WebTransformationMatrix&
// Compute the normal of the layer's plane.
bool clipped = false;
- FloatPoint3D c1 = MathUtil::mapPoint(drawTransform, FloatPoint3D(0, 0, 0), clipped);
- FloatPoint3D c2 = MathUtil::mapPoint(drawTransform, FloatPoint3D(0, 1, 0), clipped);
- FloatPoint3D c3 = MathUtil::mapPoint(drawTransform, FloatPoint3D(1, 0, 0), clipped);
+ gfx::Point3F c1 = MathUtil::mapPoint(drawTransform, gfx::Point3F(0, 0, 0), clipped);
+ gfx::Point3F c2 = MathUtil::mapPoint(drawTransform, gfx::Point3F(0, 1, 0), clipped);
+ gfx::Point3F c3 = MathUtil::mapPoint(drawTransform, gfx::Point3F(1, 0, 0), clipped);
// FIXME: Deal with clipping.
- FloatPoint3D c12 = c2 - c1;
- FloatPoint3D c13 = c3 - c1;
- layerNormal = c13.cross(c12);
+ gfx::Vector3dF c12 = c2 - c1;
+ gfx::Vector3dF c13 = c3 - c1;
+ layerNormal = gfx::CrossProduct(c13, c12);
transformOrigin = c1;
}
@@ -200,11 +200,11 @@ LayerShape::~LayerShape()
// of the layer.
float LayerShape::layerZFromProjectedPoint(const gfx::PointF& p) const
{
- const FloatPoint3D zAxis(0, 0, 1);
- FloatPoint3D w = FloatPoint3D(cc::FloatPoint(p)) - transformOrigin;
+ gfx::Vector3dF zAxis(0, 0, 1);
+ gfx::Vector3dF w = gfx::Point3F(p) - transformOrigin;
- float d = layerNormal.dot(zAxis);
- float n = -layerNormal.dot(w);
+ float d = gfx::DotProduct(layerNormal, zAxis);
+ float n = -gfx::DotProduct(layerNormal, w);
// Check if layer is parallel to the z = 0 axis which will make it
// invisible and hence returning zero is fine.
« cc/cc.gyp ('K') | « cc/layer_sorter.h ('k') | cc/math_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698