OSDN Git Service

Support 3D rotations when drawing text
authorRomain Guy <romainguy@google.com>
Thu, 28 Feb 2013 20:15:35 +0000 (12:15 -0800)
committerRomain Guy <romainguy@google.com>
Fri, 1 Mar 2013 00:04:48 +0000 (16:04 -0800)
commita4adcf0239039eb8f005be252409901c41b28839
treebb339ae27217db42e4ef0de743b07ca138ef335a
parentaaa46155ec80f02b37ec858408d7dabbf9bc289a
Support 3D rotations when drawing text

If a perspective transform is set on the Canvas, drawText() should
not attempt to rasterize glyphs in screen space. This change uses
the old behavior instead (i.e. rasterize the glyphs at the native
font size and apply the transform on the resulting mesh.)

This change also adds an optimization: empty glyphs (spaces) do
not generate vertices anymore. This saves a lot of vertices in text
heavy applications such as Gmail.

Change-Id: Ib531384163f5165b5785501612a7b1474f3ff599
libs/hwui/DisplayListRenderer.cpp
libs/hwui/FontRenderer.cpp
libs/hwui/OpenGLRenderer.cpp
libs/hwui/font/Font.cpp
libs/hwui/font/Font.h
tests/HwAccelerationTest/AndroidManifest.xml
tests/HwAccelerationTest/src/com/android/test/hwui/Rotate3dTextActivity.java [new file with mode: 0644]