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

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: 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
Index: cc/CCMathUtil.cpp
diff --git a/cc/CCMathUtil.cpp b/cc/CCMathUtil.cpp
index d90eb090abef6fbc004f87cedc0a3188419486cf..6377f645f9cb0ad99f547524b342425f21f3a779 100644
--- a/cc/CCMathUtil.cpp
+++ b/cc/CCMathUtil.cpp
@@ -361,6 +361,13 @@ void CCMathUtil::flattenTransformTo2d(WebTransformationMatrix& transform)
transform.setM43(0);
}
+FloatPoint CCMathUtil::computeTransform2dScaleComponents(const WebTransformationMatrix& transform)
+{
+ FloatPoint3D xAxis(transform.m11(), transform.m12(), transform.m13());
+ FloatPoint3D yAxis(transform.m21(), transform.m22(), transform.m23());
+ return FloatPoint(xAxis.distanceTo(FloatPoint3D()), yAxis.distanceTo(FloatPoint3D()));
+}
+
float CCMathUtil::smallestAngleBetweenVectors(const FloatSize& v1, const FloatSize& v2)
{
float dotProduct = (v1.width() * v2.width() + v1.height() * v2.height()) / (v1.diagonalLength() * v2.diagonalLength());

Powered by Google App Engine
This is Rietveld 408576698