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

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: initialCssScale 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
Index: cc/CCMathUtil.cpp
diff --git a/cc/CCMathUtil.cpp b/cc/CCMathUtil.cpp
index d90eb090abef6fbc004f87cedc0a3188419486cf..0a2b2070179c2afbfd2cddd70b62127a228aadc9 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((p1.x() - p2.x()) * (p1.x() - p2.x()) + (p1.y() - p2.y()) * (p1.y() - p2.y()));
+}
+
} // namespace cc

Powered by Google App Engine
This is Rietveld 408576698