From c74f45a334f0e3725c23cdd270cbcb0efac4ea75 Mon Sep 17 00:00:00 2001 From: Romain Guy Date: Tue, 26 Feb 2013 19:10:14 -0800 Subject: Properly scale text This change does not apply to drawPosText() and drawTextOnPath() yet. Prior to this change, glyphs were always rasterized based on the font size specified in the paint. All transforms were then applied on the resulting texture. This creates rather ugly results when text is scaled and/or rotated. With this change, the font renderer will apply the current transform matrix to the glyph before they are rasterized. This generates much better looking results. Change-Id: I0141b6ff18db35e1213e7a3ab9db1ecaf03d7a9c --- libs/hwui/Matrix.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'libs/hwui/Matrix.cpp') diff --git a/libs/hwui/Matrix.cpp b/libs/hwui/Matrix.cpp index 5cec5a83c9a2..2d017dfd0691 100644 --- a/libs/hwui/Matrix.cpp +++ b/libs/hwui/Matrix.cpp @@ -39,6 +39,11 @@ static const float EPSILON = 0.0000001f; // Matrix /////////////////////////////////////////////////////////////////////////////// +const Matrix4& Matrix4::identity() { + static Matrix4 sIdentity; + return sIdentity; +} + void Matrix4::loadIdentity() { data[kScaleX] = 1.0f; data[kSkewY] = 0.0f; -- cgit v1.2.3-59-g8ed1b