summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYongqin Liu <yongqin.liu@linaro.org>2012-09-26 17:37:04 +0800
committerBernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org>2012-11-14 12:47:40 +0100
commit7bd058a94c9017e7cb1018da77e6b15a042e15b8 (patch)
tree98dd35b1587cf0b49717d59f10fba7d5faaed222
parente021da0f9073dc40fe23d9811c750b2539fc52ab (diff)
downloadbase-7bd058a94c9017e7cb1018da77e6b15a042e15b8.tar.gz
frameworks/base:(Hack)Print the content displayed with Canvas.drawText
This hack allows us to print content that displayed with the drawText method of Canvas.java when ro.debug.drawtext is set to true. This allows us to capture the contents on the screeen which will help us capture benchmark results for thirdparty apps which use drawText of Canvas to display results. Change-Id: Ic114fbe8d469ff27df57c585d3af322c703b4b83 Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
-rw-r--r--graphics/java/android/graphics/Canvas.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/graphics/java/android/graphics/Canvas.java b/graphics/java/android/graphics/Canvas.java
index 3949afdd4a2a..d085c5e8054d 100644
--- a/graphics/java/android/graphics/Canvas.java
+++ b/graphics/java/android/graphics/Canvas.java
@@ -16,10 +16,12 @@
package android.graphics;
+import android.os.SystemProperties;
import android.text.GraphicsOperations;
import android.text.SpannableString;
import android.text.SpannedString;
import android.text.TextUtils;
+import android.util.Log;
import javax.microedition.khronos.opengles.GL;
@@ -37,6 +39,9 @@ import javax.microedition.khronos.opengles.GL;
* Canvas and Drawables</a> developer guide.</p></div>
*/
public class Canvas {
+
+ static final String LOG_TAG = "Canvas";
+
// assigned in constructors, freed in finalizer
final int mNativeCanvas;
@@ -1342,6 +1347,9 @@ public class Canvas {
* @param paint The paint used for the text (e.g. color, size, style)
*/
public void drawText(String text, float x, float y, Paint paint) {
+ if (SystemProperties.getBoolean("ro.debug.drawtext", false)) {
+ Log.d(LOG_TAG, text);
+ }
native_drawText(mNativeCanvas, text, 0, text.length(), x, y, paint.mBidiFlags,
paint.mNativePaint);
}