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

Unified Diff: cc/CCMathUtil.cpp

Issue 10915313: cc: Apply the layer's initial CSS scale to the contentsScale to render text at the right resolution. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove extra header Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/CCMathUtil.h ('k') | cc/CCOcclusionTrackerTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/CCMathUtil.cpp
diff --git a/cc/CCMathUtil.cpp b/cc/CCMathUtil.cpp
index d90eb090abef6fbc004f87cedc0a3188419486cf..751edba0e98ddeeca521b760d4cce8079dafc290 100644
--- a/cc/CCMathUtil.cpp
+++ b/cc/CCMathUtil.cpp
@@ -9,6 +9,7 @@
#include "FloatPoint.h"
#include "FloatQuad.h"
#include "IntRect.h"
+#include <math.h>
#include <public/WebTransformationMatrix.h>
using WebKit::WebTransformationMatrix;
@@ -376,4 +377,9 @@ FloatSize CCMathUtil::projectVector(const FloatSize& source, const FloatSize& de
return FloatSize(projectedLength * destination.width(), projectedLength * destination.height());
}
+float CCMathUtil::distanceBetweenPoints(const FloatPoint& p1, const FloatPoint& p2)
+{
+ return sqrtf(fabs(p1.x() - p2.x()) * fabs(p1.x() - p2.x()) + fabs(p1.y() - p2.y()) * fabs(p1.y() - p2.y()));
piman 2012/09/17 23:53:37 nit: no needs for fabs here. x² == |x|²
danakj 2012/09/17 23:55:05 o right :) thanks.
+}
+
} // namespace cc
« no previous file with comments | « cc/CCMathUtil.h ('k') | cc/CCOcclusionTrackerTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698